spring-cloud / spring-cloud/spring-cloud-commons
LegacyContextRefresher not removing a property source from the config client configuration when the property source has been removed from the config server
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 751
- Forks
- 744
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 9
Description
Concerning LegacyContextRefresher in spring-cloud-context 3.1.1
When a config server configuration for an application "test" and active profile "local" changes from something like
{
"name": "test",
"profiles": [
"local"
],
"label": null,
"version": null,
"state": null,
"propertySources": [
{
"name": "test-local",
"source": {
"some-property": "overridden"
}
},
{
"name": "classpath:/configuration/application-local.yml",
"source": {
"some-property": "config-file"
}
}
]
}
to something like
{
"name": "test",
"profiles": [
"local"
],
"label": null,
"version": null,
"state": null,
"propertySources": [
{
"name": "classpath:/configuration/application-local.yml",
"source": {
"some-property": "config-file"
}
}
]
}
the property "some-property" seems to retain the value "overriden" in the config client's configuration because the property source "test-local" that has been removed from the config server does not seem to get removed from the configuration of the config client upon context refresh via ContextRefresher.refresh().
There seems to be no code in LegacyContextRefresher that would handle such situations.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with LegacyContextRefresher in spring-cloud-context 3.1.1 and follow the ContextRefresher.refresh() path. Reproduce the change from two property sources to one, then verify that the removed source no longer contributes its value and that the remaining source still does.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring, spring-boot
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100