fix:fix nacos enabled condition bugs. (#794)

pull/801/head
Haotian Zhang 2 years ago committed by GitHub
parent ee14101339
commit b3feb94b73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,3 +21,4 @@
- [Bugfix: fix reactor concurrent bug when get instances & fix spring-retry fuse not working bug](https://github.com/Tencent/spring-cloud-tencent/pull/775)
- [Fix issue: prompt no registration if web dependence was not imported.](https://github.com/Tencent/spring-cloud-tencent/pull/777)
- [set reporter.enabled default to true](https://github.com/Tencent/spring-cloud-tencent/pull/786)
- [fix:fix nacos enabled condition bugs.](https://github.com/Tencent/spring-cloud-tencent/pull/794)

@ -36,12 +36,18 @@ public class DiscoveryEnabledCondition implements Condition {
boolean isConsulDiscoveryEnabled = Boolean.parseBoolean(
conditionContext.getEnvironment().getProperty("spring.cloud.consul.enabled", "false"))
&& Boolean.parseBoolean(conditionContext.getEnvironment()
.getProperty("spring.cloud.consul.discovery.enabled", "true"));
&& Boolean.parseBoolean(
conditionContext.getEnvironment().getProperty("spring.cloud.consul.discovery.enabled", "true"));
boolean isNacosEnabled = Boolean.parseBoolean(
conditionContext.getEnvironment().getProperty("spring.cloud.nacos.discovery.enabled", "false"));
isDiscoveryEnabled |= isConsulDiscoveryEnabled;
return isDiscoveryEnabled || isConsulDiscoveryEnabled || isNacosEnabled;
boolean isNacosDiscoveryEnabled = Boolean.parseBoolean(
conditionContext.getEnvironment().getProperty("spring.cloud.nacos.enabled", "false"))
&& Boolean.parseBoolean(
conditionContext.getEnvironment().getProperty("spring.cloud.nacos.discovery.enabled", "true"));
isDiscoveryEnabled |= isNacosDiscoveryEnabled;
return isDiscoveryEnabled;
}
}

@ -39,6 +39,15 @@ public class RegisterEnabledCondition implements Condition {
.getProperty("spring.cloud.consul.discovery.register", "true"));
isRegisterEnabled |= isConsulRegisterEnabled;
boolean isNacosRegisterEnabled = Boolean
.parseBoolean(conditionContext.getEnvironment()
.getProperty("spring.cloud.nacos.enabled", "false"))
&& Boolean.parseBoolean(conditionContext.getEnvironment()
.getProperty("spring.cloud.nacos.discovery.register-enabled", "true"));
isRegisterEnabled |= isNacosRegisterEnabled;
return isRegisterEnabled;
}
}

@ -73,7 +73,7 @@
<revision>1.9.0-2020.0.5-SNAPSHOT</revision>
<!-- Dependencies -->
<polaris.version>1.10.1-SNAPSHOT</polaris.version>
<polaris.version>1.10.1</polaris.version>
<logback.version>1.2.11</logback.version>
<mocktio.version>4.5.1</mocktio.version>
<byte-buddy.version>1.12.10</byte-buddy.version>

Loading…
Cancel
Save