-
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
Optional meta should really be optional #3720
Comments
Hey you can mimic this behavior by just adding the default value as follows:
|
Hmm, okay. Not really that intuitive though, and undocumented as far as I can see? Wait, that doesn't work, now the output is always I would expect an optional, non provided variable to become "", as I am used to with other scripts and template languates |
So how are meta optional variables meant to work?
This is literally passing "${NOMAD_META_CANONICAL_PATH}" to my Dockerfile's entrypoint.sh:
My |
Hi @tino, I spent some time looking into this issue and wanted to let you know what I've found thus far. In the jobfile reported I see The documentation for the I tried reproducing the behavior @sevagh described with the following jobspec on nomad
|
After chatting with @dadgar about this one it seems like the root of the issue is that optional metadata interpolation (like all other variable interpolation) returns the token as the value if unset. For optional metadata it is much more expected that an empty string is returned. This something we'll be working on fixing. |
Unfortunately the original PR didn't fix this. The correct fix which we will get in for 0.9.0, is to attached the parameterized configuration to the dispatched job but to add a boolean field that specifies that it is the dispatched instance. Then we can use that new field to determine if the alloc is an instance of a dispatched job and keep all the changes from the original PR. |
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. |
Nomad version
0.6.3
Operating system and Environment details
Ubuntu 16.04
Issue
Omitting a
meta_optiona
parameter leads to the verbatim name of the variable in the output:I would expect:
before after
Reproduction steps
nomad run jobfile.nomad
nomad job dispatch -meta command=echo test_meta_optional
nomad logs <alloc-id>
Job file (if appropriate)
The text was updated successfully, but these errors were encountered: