Make Post Processor honor spring.cloud.kubernetes.enabled
Fixes:
@@ -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()) {
