-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Version 4.0.4, unable to connect to Cloud Config if we have cloud config profile and spring environment profile. #2349
Comments
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file. |
Hi @ryanjbaxter , I am preparing a sample with out exposing specific details. 1.Spring allows multiple profiles 2.At line 116, properties.setProfile(String.join(",", combineProfiles(properties, environment))); 3.And we are sending this profile as a path parameter to a GET call at line 291 where args is either = new String[] { name, profile }; or new String[] { name, profile, label }; So, we are ending up having a comma separated URL in a Http GET call FILE: ConfigServicePropertySourceLocator.java |
Hi @ryanjbaxter , Here is an example. You can run below project as a Spring Boot application.
spring.cloud.config: Now when I am starting application, I am getting URL as profiles with comma separated and failing. GET request for "http://localhost:8888/CONFIG_NAME/CONFIG_PROFILE,logging-profile/CONFIG_LABEL |
I think I understand what you are saying now... If you set |
yes @ryanjbaxter , your understanding is correct. |
Fixes spring-cloud#2349 Revert "Make method clearer" This reverts commit fda8596568fb035d8c7839eeef6edaae712b427f. Make method clearer
Description:
We have a profile property to connect to cloud config.(spring.cloud.config.profile)
with spring-cloud-config-client-4.0.4.jar, in class ConfigServicePropertySourceLocator, there is a new method which combines profile from property and environment with comma separated.
So, finally profile value while connecting to cloud config will be like below and failing cloud config call.
HTTP GET https://XXXXXXXXXX/cloud-config/properties//<PROFILE-XYX,ABC>/
This is failing.
Even though profile properties are overrider at line 122 ConfigClientProperties properties = this.defaultProperties.override(environment);
in the next line, profile value is getting updated by appending with all the profiles
properties.setProfile(String.join(",", combineProfiles(properties, environment)));
So in method getRemoteEnvironment, while preparing the URL, profile path param is goign as comma separated and there by causing issue.
The text was updated successfully, but these errors were encountered: