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

[data/values] support specifying data values via cmd args that are not present in file data values #81

Open
cppforlife opened this issue Jan 22, 2020 · 5 comments
Labels
discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution

Comments

@cppforlife
Copy link
Contributor

cppforlife commented Jan 22, 2020

in some cases it's useful to specify data values that are not present in file data values via cmd arg. since cmd args are overlayed on top of file data values they need to have annotation overlay/match missing_ok=True set on them.

ytt -f config.yml -v something+.namespace=blah

we can try to assign special character (+) that could be used to indicate that.

TBD:

  • should this also apply to env vars? (env vars are constrained to a-zA-Z0-9_ unfortunately)

👍 "I have this use-case and would be served by having this feature implemented"
👎 "I think implementing this feature would do more harm than good."

@cppforlife cppforlife added the discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution label Jan 22, 2020
@cppforlife cppforlife changed the title support specifying missing_ok=True for data value cmd args via special character [data/values] support specifying missing_ok=True for data value cmd args via special character Jan 22, 2020
@cppforlife cppforlife added the in progress Work has begun by a community member or a maintainer; this issue may be included in a future release label Feb 24, 2020
@cppforlife
Copy link
Contributor Author

+ was chosen to be friendly to shells.

@cppforlife cppforlife changed the title [data/values] support specifying missing_ok=True for data value cmd args via special character [data/values] support specifying data values via cmd args that are not present in file data values Mar 30, 2020
@pivotaljohn
Copy link
Contributor

User (specifically a Configuration Author) reports

This is also somewhat an artifact of the way (my project) is structured, and the way I'm choosing to provide these parameters. Eventually I want to provide them as a secret, and have this just be a default option within (my project), but I need to demonstrate that this is valuable first, so, going with a slightly less elegant but cheaper to implement option to start with.

@pivotaljohn pivotaljohn removed the in progress Work has begun by a community member or a maintainer; this issue may be included in a future release label Oct 21, 2020
@pivotaljohn
Copy link
Contributor

Currently reconsidering.

The currently supported way of doing this is to pair any newly-introduced template with an explicit data values overlay file that "declares" the additional keys (with reasonable defaults or zero values)... and then the -v and friends are available from the command-line.

@pivotaljohn
Copy link
Contributor

As mentioned in #carvel ~Feb 2021...

In GitLab documentation on "Dynamic child pipelines", there's a pointer to ytt. It's easy to make the inference that one merely reference the many pre-defined variables in your templates and Bob's yer uncle. ... which would be true if we implemented this feature. (note the reliance on environment variables, in this case).

@erikgb
Copy link

erikgb commented Feb 20, 2021

In GitLab documentation on "Dynamic child pipelines", there's a pointer to ytt. It's easy to make the inference that one merely reference the many pre-defined variables in your templates and Bob's yer uncle. ... which would be true if we implemented this feature. (note the reliance on environment variables, in this case).

There is also an open GitLab issue to add an example of child/parent pipelines with ytt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion This issue is not a bug or feature and a conversation is needed to find an appropriate resolution
Projects
Status: To Triage
Development

No branches or pull requests

3 participants