-
Notifications
You must be signed in to change notification settings - Fork 908
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
Show warning when kubectl set env from secret leads to uppercase of the secret keys #1171
Comments
/sig cli |
Hi @ThuF |
Platforms can treat environment variable name case-sensitivity differently. This is why it's been accepted as good practice to use all uppercase environment variable names. The Google Style Guide recommends this as well: https://google.github.io/styleguide/shellguide.html#s7.3-constants-and-environment-variable-names |
Thanks, @deejross for this information. |
@Shubham82, @deejross, thanks for the comments! I totally agree that's a good practice to use uppercase environment variables, but there are cases where lowercase/camelcase/etc. format of the keys is expected, due to legacy reasons or simply limitation of the platform. For example, you could take a look at https://kyma-project.io/ and its implementation as part of the SAP BTP, Kyma environment. As described in this blog a Authorization & Trust Management service instance is created, which contains only lowercase keys (that's part of the implementation of the service instance binding) and that can't be modified. So a Secret containing these lower keys is created (as part of the Service Instance Binding) and can't be updated. What I have as a workaround is to edit the Deployment and update the case sensitive environment variables. |
At a minimum, we should clearly document this behavior (consider opening an issue against k/website to request that). It would also be useful to have |
/remove-kind bug |
@sftim Hey, I would like to add a warning in case the key rewritten to uppercase. Since it has not been triaged, could I go for it now? |
/triage accepted |
PRs welcome! |
@sftim: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Oh, sorry. I was thinking this was the documentation issue. I'm the wrong person to ask about adding the warning to |
@ThuF: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/transfer kubectl |
/retitle Show warning when kubectl set env from secret leads to uppercase of the secret keys /kind feature |
Agreed. We would accept a PR that adds a warning if the to upper is different from original. @jlsong01 did you still want to take this one? /triage accepted |
/assign |
What happened?
I have a Secret created by the following command:
I'm binding the secret to a Deployment with the following command:
When describing the deployment I get the following output:
Where the environment variables are in uppercase:
What did you expect to happen?
The environment variables to be in lowercase, as they are defined in the secret.
How can we reproduce it (as minimally and precisely as possible)?
Shown in the description.
Anything else we need to know?
No response
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: