-
Notifications
You must be signed in to change notification settings - Fork 1k
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
spring.config.import reading incorrect data when profiles are involved #1874
Comments
Can you elaborate on what you mean by this? I am not sure I understand what you mean by using the profile when binding happens. |
sorry, should have been more verbose. At the moment, we do something like this:
which binds the property : My point about
notice that |
So I am trying to wrap my head around this so sorry if I am asking what seems like obvious questions... application.yaml and application-dev.yaml are not in a configmap they are configuration files in the application itself? If that is a correct assumption, you are activating the profile |
Yes, correct. Here is a sample that proves this. I had to alter the names a bit in the sample compared to what we have above because of You will have to clone the repo and switch to that branch, there are README instructions there. |
Sorry upfront for the bad title, I could not figure out of a better one.
It looks a bit related to this issue what I am going to describe next.
If I have an
application.yaml
:and
application-dev.yaml
:and I do two things 1) use
spring.cloud.import:kubernetes
2) makedev
an active profile.In this case, our code will bind
sample-configmap
as the name. This was un-expected for me, as I really thought it should besample-configmap-dev
. The logic happens inKubernetesConfigDataLocationResolver::resolveProfileSpecific
and, although that method accepts aProfiles profiles
I did not find any way to use thatprofile
when binding (usingBinder
) happens.Looking around a little and reading some of the threads on the matter (though I vaguely understand the idea), it seems that this is normal? And there is not much we can do, but suggest to users in such cases to use the bootstrap?
Thank you.
The text was updated successfully, but these errors were encountered: