Allow :
colons in data value flags yaml keys
#637
Labels
enhancement
This issue is a feature request
:
colons in data value flags yaml keys
#637
Describe the problem/challenge you have
It is valid yaml to have a colon in a YAML key and the
-f
flag allows it:However, when using data values flags, this is disallowed:
$ ytt --data-value a:key=valid
$ ytt --data-value-yaml a:key=valid
Note: the below
:
in the environment variable key is invalid in unix, but may be valid in windowsall result in an error:
ytt: Error: Extracting data value from KV: Expected library ref to start with '@'
Describe the solution you'd like
Do not report this as an error.
Anything else you would like to add:
YAML separates a key and a value using a colon and a space. So a colon can appear in a key as long as it's not followed by a space.
Considerations
I believe we should allow data values flags to contain
:
because it is valid yaml and I want to hear if users are running into this. However, it currently serves a purpose to catch syntax errors when incorrectly using a library reference. For example:We catch this syntax error: if there are two colons in the library reference:
ytt --data-value @libraryName::key=value
. If we decide to allow:
in keys then this becomes valid.Current workaround
If you are unable to do this:
$ ytt --data-value a:key=valid
Then put the key in a file and load it
Please share you thoughts on this.
Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
The text was updated successfully, but these errors were encountered: