Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config fetched from config server for profiles with a dash stopped working with spring-cloud-config 3.1.1 #2075

Closed
MarkvanOsch opened this issue Apr 7, 2022 · 3 comments

Comments

@MarkvanOsch
Copy link

MarkvanOsch commented Apr 7, 2022

I upgraded the spring cloud config server from spring cloud to 2021.0.0 to 2021.0.1. With this spring-cloud-config is upgraded from 3.1.0 to 3.1.1.

With the upgrade config fetched from the configuration server for profiles with dashes stopped working.

My analysis is that this is caused by the path pattern matching change for fixing this bug:
#2020
And adjusting the EnvironmentController here:
1913b2a

The spring cloud configuration server is backed by a git repo and the property files are all in yaml.

I could reproduce this bug with integration testing. Using spring cloud 2021.0.0 profiles like "test-1" worked fine, with 2021.0.1 not anymore.

An examples used in test of endpoints used to get config for a specific profile with a dash:
/configuration/application-x/test-1

An example of the error we get in a spring boot application using this config server after upgrading:

.... SpringBootApp                      : The following 1 profile is active: "test-1"
o.s.b.context.config.ConfigDataLoader    : Fetching config from server at : https://config-server-url
o.s.b.context.config.ConfigDataLoader    : Could not locate PropertySource ([ConfigServerConfigDataResource@6127a7e uris = array<String>['https://config-server-url'], optional = true, profiles = list['test-1']]): None of labels [] found
@MarkvanOsch MarkvanOsch changed the title Config fetched from server for profiles with a dash stopped working with spring-cloud-config 3.1.1 Config fetched from config server for profiles with a dash stopped working with spring-cloud-config 3.1.1 Apr 7, 2022
@MarkvanOsch
Copy link
Author

Why I believe this to be a bug and should be supported, for reference the latest spring-framework docs where for example profiles "us-east" and "eu-central" are mentioned, both also containing dashes in the profile name.

https://docs.spring.io/spring-framework/docs/5.3.18/reference/html/core.html#beans-definition-profiles-java

@ryanjbaxter
Copy link
Contributor

Can you try 2021.0.2-SNAPSHOTS? I believe we already fixed this issue.

#2058

@MarkvanOsch
Copy link
Author

MarkvanOsch commented Apr 7, 2022

@ryanjbaxter Hi Ryan, confirmed, this is fixed with 2021.0.2-SNAPSHOT version. All my tests succeed now. Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants