-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Specify that -
is replaced by _
when changing meta keys into environment variables
#15359
Comments
Hi @Kamilcuk! This definitely needs better documentation. We should probably also update the docs for the In the meantime, the code that calls this is in |
Amazing, thank you for code links and clarification. |
The keys of `meta` fields have all characters outside of `[A-Za-z0-9_.]` replaced by underscores when we create `NOMAD_META` environment variables. Make sure this replacement is documented. Fixes: #15359
The keys of `meta` fields have all characters outside of `[A-Za-z0-9_.]` replaced by underscores when we create `NOMAD_META` environment variables. Make sure this replacement is documented. Fixes: #15359
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
On the documentation page https://developer.hashicorp.com/nomad/docs/runtime/environment#meta it is not explained that meta keys have replaced
-
for_
when transformed into environment variables. Although variables with-
in the name can't be accessed with unix shell, they are technically perfectly valid environment variable names. I tried to follow the source code https://github.com/hashicorp/nomad/blob/main/client/taskenv/env.go#L115 but with no success.Proposal
Please specify in the documentation that meta keys containing
-
are replaced by_
when transformed into environment variables.Please also specify if other characters are replaced? Do all non-alphanumeric characters in meta keys are replaced by underscores?
Use-cases
Currently, this behavior I believe would count as "unspecified". Or it is specified in the documentation, but I have not found it, that's on me.
Attempted Solutions
outputs:
The environment variable is
NOMAD_META_key_key
notNOMAD_META_key-key
.The text was updated successfully, but these errors were encountered: