carvel-dev / ytt

YAML templating tool that works on YAML structure instead of text
https://carvel.dev/ytt
Apache License 2.0
1.65k stars 135 forks source link

[data/values] improve error message when value is specified as a flag and not data values file #72

Open cppforlife opened 4 years ago

cppforlife commented 4 years ago

slack thread: https://kubernetes.slack.com/archives/CH8KCCKA5/p1576624551037500

current error messsage:

$ cat example.yaml
#@ load("@ytt:data", "data")
---
boo: #@ data.values.foo

$ ytt -f example.yaml --data-value foo="asdf"
Error: Processing data values: Overlaying additional data values on top of data values from files (marked as @data/values): Document on line ?: Map item (key 'foo') on line ?: Expected number of matched nodes to be 1, but was 0
garethr commented 4 years ago

I think this represents what I was trying to do. ie.

Have a template that I could override specific values in using the flags.

Is this possible today in some other way? The title suggests improving the error messaging.

Note that the slack link is no longer valid, as the Kubernetes Slack doesn't retain history for very long.

cppforlife commented 4 years ago

@garethr here is the issue for the feature: https://github.com/k14s/ytt/issues/81. this issue was more about making the error more clear about why the failure happens.