spring-cloud-config icon indicating copy to clipboard operation
spring-cloud-config copied to clipboard

When using spring.config.import with configserver , we cannot override with local files

Open tsemachh opened this issue 3 years ago • 4 comments
trafficstars

Hi When using new Spring Boot spring.config.import with configserver , we cannot override with local files

application.yml

spring:
  application:
    name: api-gateway
  profiles:
    active: devgateway  #,integ4,prod
  config:
    import: "optional:configserver:http://hrhadad.snifim.blroot:8889,developer.yml"

Config Server GIT (Tried also other combinations)

spring:
  cloud:
    config:
      allowOverride: true
      overrideNone: true
      overrideSystemProperties: false
apache.server=http://localhost:9080

developer.yml apache.server: http://localhost:18090

Expected apache.server to be http://localhost:18090 Actually we got http://localhost:9080

The only way we managed to override was using application.properties , we do expect that order will matter in this case/ thx tsemach

tsemachh avatar Nov 24 '21 12:11 tsemachh

If you set apache.server in application.yaml | properties or if you set it as an environment variable does the problem still occur?

ryanjbaxter avatar Nov 24 '21 15:11 ryanjbaxter

application.properties the problem didn't occur application.yml the problem occured

tsemachh avatar Nov 24 '21 15:11 tsemachh

So when you use application.properties everything worked as expected, but when you use application.yml you were still seeing the value from the config server?

What if you set the property via an environment variable?

ryanjbaxter avatar Nov 24 '21 15:11 ryanjbaxter

Yes properties worked o.k yml didn't Also any other file besides application.properties didn't work. Environment variables set properties ok

tsemachh avatar Nov 24 '21 16:11 tsemachh

Can you please try and reproduce this with Spring Cloud 2021.0.x or Spring Cloud 2022.0.x?

ryanjbaxter avatar May 08 '23 23:05 ryanjbaxter

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues avatar May 16 '23 00:05 spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-cloud-issues avatar May 23 '23 00:05 spring-cloud-issues