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

ConfigData imports cannot override profile specific imports #25766

Closed
nagsuchandra opened this issue Mar 23, 2021 · 2 comments
Closed

ConfigData imports cannot override profile specific imports #25766

nagsuchandra opened this issue Mar 23, 2021 · 2 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@nagsuchandra
Copy link

nagsuchandra commented Mar 23, 2021

Description:

Lets say there is a profile baz.

classpath:application-baz (local to jar) is overriding application-baz from spring cloud config repository, which is incorrect.

i.e., values from jar local property source gets precedence over the spring cloud config repo's property source.

Test case illustrating the issue:
spring-cloud/spring-cloud-config#1839 --> This PR has the test case in it .

See open issue on spring cloud board:
spring-cloud/spring-cloud-config#1838

Spring cloud has suggested the bug to be logged under spring boot.

The workaround we have been applying is

  • remove spring.config.import from application's src/main/resources/application.yml
  • set spring.config.import as JAVA_OPTS when starting the service.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 23, 2021
@philwebb philwebb self-assigned this Mar 24, 2021
@philwebb philwebb changed the title Spring boot 2.4.2 reverses the property order precedence if spring.config.import is supplied via application.yml ConfigData imports cannot override profile specific imports Apr 5, 2021
@philwebb philwebb added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 5, 2021
@philwebb philwebb added this to the 2.4.x milestone Apr 5, 2021
@philwebb
Copy link
Member

philwebb commented Apr 6, 2021

Thanks for reporting the issue, this particular use-case was overlooked when we designed the new ConfigData data support. I've pushed something that I hope will allow Spring Cloud to support profile specific imports.

@philwebb philwebb modified the milestones: 2.4.x, 2.4.5 Apr 6, 2021
philwebb added a commit that referenced this issue Apr 6, 2021
@maggmanu77
Copy link

Thank you @philwebb for taking care of this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

4 participants