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
Add API for PropertySource resource location retrieval #24504
Comments
This one is a bit tricky. If I've read the code correctly, you ideally want a way to get the The only ideas I've had so far are to either try to create some kind of registry that links a I definitely needs more thought. |
@spencergibb I've pushed something to 2.4.x, can you take a look and see if you think it will work. I hope you can update TrackingConfigDataEnvironmentUpdateListener listener = new TrackingConfigDataEnvironmentUpdateListener()
ConfigurableEnvironment environment = getEnvironment(config, profile, label, listener);
...
ConfigDataEnvironmentPostProcessor.applyTo(environment, resourceLoader, null,
StringUtils.commaDelimitedListToStringArray(profile), listener); The You can then hopefully update the Let me know if that doesn't work and we can have another go. |
I'll take a look in an hour or so. |
Reopening to make |
Update `StandardConfigDataResource` to make the `getResource()` method public so that it can be used by Spring Cloud. Closes gh-24504
Spring Cloud Config Server verifies that any property sources it loads are from configured locations for security. To do that has used the property source name to get this information.
In boot 2.3.x we got classpath:/configs/application.yaml from
applicationConfig: [classpath:/configs/application.yaml]
.In boot 2.4.0 we updated the parsing logic in spring-cloud/spring-cloud-config@854060b
#24428 changed the property source names and hence broke config server. It has been updated again as seen in the issue below, but this is a brittle approach. We likely didn't say anything in the 2.3.x or prior timeline because it didn't change.
I've added support for checking the location by parsing
classpath:/configs/
fromConfig resource 'class path resource [configs/application.yml]' via location 'classpath:/configs/' (document #0)
which works for both 2.4.0 and 2.4.1.spring-cloud/spring-cloud-config#1771
/cc @philwebb
The text was updated successfully, but these errors were encountered: