From fc96148aac205a5f6a94864f6154a8d07a40076e Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Fri, 16 Dec 2016 18:33:45 -0700 Subject: [PATCH] polish --- .../cloud/kubernetes/config/ConfigUtils.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/spring-cloud-kubernetes-core/src/main/java/org/springframework/cloud/kubernetes/config/ConfigUtils.java b/spring-cloud-kubernetes-core/src/main/java/org/springframework/cloud/kubernetes/config/ConfigUtils.java index ef9ea519..96981e4f 100644 --- a/spring-cloud-kubernetes-core/src/main/java/org/springframework/cloud/kubernetes/config/ConfigUtils.java +++ b/spring-cloud-kubernetes-core/src/main/java/org/springframework/cloud/kubernetes/config/ConfigUtils.java @@ -7,6 +7,9 @@ import org.springframework.util.StringUtils; import io.fabric8.kubernetes.client.KubernetesClient; +import static org.springframework.cloud.kubernetes.config.Constants.FALLBACK_APPLICATION_NAME; +import static org.springframework.cloud.kubernetes.config.Constants.SPRING_APPLICATION_NAME; + public class ConfigUtils { private static final Logger LOGGER = LoggerFactory.getLogger(SecretsPropertySource.class); @@ -14,13 +17,11 @@ public class ConfigUtils { public static String getApplicationName(Environment env, C config) { String name = config.getName(); if (StringUtils.isEmpty(name)) { + //TODO: use relaxed binding LOGGER.debug(config.getConfigurationTarget() + " name has not been set, taking it from property/env {} (default={})", - Constants.SPRING_APPLICATION_NAME, - Constants.FALLBACK_APPLICATION_NAME); + SPRING_APPLICATION_NAME, FALLBACK_APPLICATION_NAME); - name = env.getProperty( - Constants.SPRING_APPLICATION_NAME, - Constants.FALLBACK_APPLICATION_NAME); + name = env.getProperty(SPRING_APPLICATION_NAME, FALLBACK_APPLICATION_NAME); } return name;