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

secrets: relax key name restrictions #55

Closed
dagframstad opened this issue Apr 19, 2024 · 2 comments
Closed

secrets: relax key name restrictions #55

dagframstad opened this issue Apr 19, 2024 · 2 comments
Assignees

Comments

@dagframstad
Copy link

dagframstad commented Apr 19, 2024

Beskrivelse / Essensen

Lette på restriksjoner for nøkler tilhørende Secrets slik at vi også tillater - og .

Investeringsvilje

<1 uke

Ikke-mål

Mulig løsning i grove trekk

Oppdatere valideringskode i console-frontend og api:

For api kan man evt. bare bruke validation.IsEnvVarName() direkte.


Original comment below:

We have code that does stuff with files at startup depending on the file extension.
It would be nice to be able to use a dot (.) in a secrets key. This would be very handy when mounting the secret as a file (using fromFiles in the nais manifest).
I understand that it's impossible if the secret is used as an environment entry (envFrom), but you could fail application startup if a secret with a dot in the key is used as an environment variable (or be nice and replace the dot with an underscore at startup).

And while I'm at it, why not allow dash, -, as well?

@tronghn tronghn changed the title be able to use . in key names secrets: relax key name restrictions Apr 22, 2024
@tronghn
Copy link
Contributor

tronghn commented Apr 22, 2024

Please correct me if I've misunderstood, but the short version is that you would like to be able to use the . and - characters when defining Secret keys? 🙂

The original intention was to be compliant with the POSIX shell standards for environment variable names, though this evidently complicates matters when a Secret is mounted as files.

We're likely not going to introduce implicit behaviours that modify or replace keys as that will only lead to further confusion, but we can consider relaxing the current restrictions similarily to kubernetes/kubernetes#48986

@dagframstad
Copy link
Author

Yes, thats exactly what I want.

@ybelMekk ybelMekk self-assigned this Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants