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: https://github.com/spring-cloud/spring-cloud-config/issues/2020 And adjusting the EnvironmentController here: https://github.com/spring-cloud/spring-cloud-config/pull/2031/commits/1913b2adc3e53bdc0d56ba76af7b30d21f412a30
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
Comment From: MarkvanOsch
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
Comment From: ryanjbaxter
Can you try 2021.0.2-SNAPSHOTS? I believe we already fixed this issue.
https://github.com/spring-cloud/spring-cloud-config/issues/2058
Comment From: MarkvanOsch
@ryanjbaxter Hi Ryan, confirmed, this is fixed with 2021.0.2-SNAPSHOT version. All my tests succeed now. Thx!