-
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
Handles multiple application names in CredhubEnvironmentRepository #2447
Conversation
Thanks! Could you submit this against the 4.1.x branch and we can merge it forward? @spencergibb what do you think about this change?
That could be considered breaking, so I am not sure we want to make that change in 4.1.x. I guess we could do it in main. |
Signed-off-by: kvmw <mshamsi@broadcom.com>
Signed-off-by: kvmw <mshamsi@broadcom.com>
The second commit adds the main PropertySource, even if it is empty. The only caveat is the name of the PropertySource, in case application has more than one name. For example, given |
Why change the property source name? |
PropertySource name has the following format: |
Is this how other EnvironmentRepositories handle this situation as well? |
If you mean splitting the application name, yes. In other repos application name is converted to an array and each individual item in array makes a separate property source. If you are referring to empty property sources, no. not all of them. For example, Vault does not create empty property source. |
Yes I was referring to the name, I just want to be as consistent as possible. |
JGit behaves the same. a sample config like this: spring:
profiles:
active: development,production
application:
name: cook,chef will have the following property sources :
|
The PR updates
CredhubEnvironmentRepository
to handle following cases:application name can be a comma separated string like
foo,bar,baz
. In this case, It should be spilted and each entry should be treated as app name. So the repository should search forfoo/profile/label
,bar/profile/label
,baz/profile/label
and finallyapplication/profile/label
. This was handled in other repositories like JGit or Valut but not in CredHub.If the default application name (
application
) is included in that comma separated string (like for example:foo,application,bar
) it should be removed and added back to the end of the list. To make sure the default property source is added to the end of the list. Again other repositories are taking care of this but not CredHub.same for default profile (
default
). If it's included in the profile string (profile1,default,profile2
), It should be removed and added back to the end of the list. Again other repositories are taking care of this but not CredHub.Also, In current implementation, If there are no secrets at all in CredHub an empty
PropertySource
will be added to the environment (envrionment.propertySources
will have onePropertySource
which has no properties) . But this PR skips that andenvrionment.propertySources
will be empty. If this is not desired, I can add that emptyProperySource
back.