Make Post Processor honor spring.cloud.kubernetes.enabled (#421)

Fixes: #420
This commit is contained in:
Georgios Andrianakis
2019-07-01 16:15:37 +03:00
committed by GitHub
parent 35f4e1f94e
commit fa9483ba24

View File

@@ -42,6 +42,12 @@ public class KubernetesProfileEnvironmentPostProcessor
@Override
public void postProcessEnvironment(ConfigurableEnvironment environment,
SpringApplication application) {
final String enabledStr = environment.getProperty("spring.cloud.kubernetes.enabled", "false");
if ("true".equals(enabledStr.toLowerCase())) {
return;
}
final StandardPodUtils podUtils = new StandardPodUtils(
new DefaultKubernetesClient());
if (podUtils.isInsideKubernetes()) {