Add spring.cloud.config.health.enabled (default true)
Fixes gh-159
This commit is contained in:
@@ -53,7 +53,7 @@ public class ConfigClientAutoConfiguration {
|
||||
@Configuration
|
||||
@ConditionalOnClass(HealthIndicator.class)
|
||||
@ConditionalOnBean(ConfigServicePropertySourceLocator.class)
|
||||
@ConditionalOnProperty(value = "spring.cloud.config.enabled", matchIfMissing = true)
|
||||
@ConditionalOnProperty(value = "spring.cloud.config.health.enabled", matchIfMissing = true)
|
||||
protected static class ConfigServerHealthIndicatorConfiguration {
|
||||
|
||||
@Bean
|
||||
@@ -62,5 +62,5 @@ public class ConfigClientAutoConfiguration {
|
||||
return new ConfigServerHealthIndicator(locator);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -60,6 +60,8 @@ public class ConfigClientProperties {
|
||||
private Discovery discovery = new Discovery();
|
||||
|
||||
private boolean failFast = false;
|
||||
|
||||
private Health health = new Health();
|
||||
|
||||
private ConfigClientProperties() {
|
||||
}
|
||||
@@ -217,6 +219,10 @@ public class ConfigClientProperties {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Health getHealth() {
|
||||
return health;
|
||||
}
|
||||
|
||||
public ConfigClientProperties override(
|
||||
org.springframework.core.env.Environment environment) {
|
||||
@@ -235,6 +241,18 @@ public class ConfigClientProperties {
|
||||
}
|
||||
return override;
|
||||
}
|
||||
|
||||
public static class Health {
|
||||
private boolean enabled = true;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
|
||||
Reference in New Issue
Block a user