From 4f31596e4fb4233c89e7d72f72933bed46ea16e5 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Thu, 10 Mar 2016 17:30:46 -0700 Subject: [PATCH] Fallback to server.port if management.port not set. See gh-896 --- .../cloud/netflix/sidecar/SidecarConfiguration.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarConfiguration.java b/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarConfiguration.java index 1e5b2174..52357293 100644 --- a/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarConfiguration.java +++ b/spring-cloud-netflix-sidecar/src/main/java/org/springframework/cloud/netflix/sidecar/SidecarConfiguration.java @@ -61,14 +61,14 @@ public class SidecarConfiguration { @Autowired private InetUtils inetUtils; - @Value("${management.port:${MANAGEMENT_PORT:${PORT:8080}}}") + @Value("${management.port:${MANAGEMENT_PORT:${server.port:${SERVER_PORT:${PORT:8080}}}}}") private int managementPort = 8080; @Value("${eureka.instance.hostname:${EUREKA_INSTANCE_HOSTNAME:}}") - String hostname; + private String hostname; @Autowired - ConfigurableEnvironment env; + private ConfigurableEnvironment env; @Bean public EurekaInstanceConfigBean eurekaInstanceConfigBean() {