carvel-dev / ytt

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

ytt version check should run before data values #159

Open pivotaljohn opened 4 years ago

pivotaljohn commented 4 years ago

When a configuration author uses a new data/values feature in their templates, and they include a version check assertion, and the configuration consumer is using an earlier version of ytt

we expect ytt to report a minimum version error:

ytt version '0.27.0' does not meet the minimum required version '0.28.0'

instead, users see an error:

Was having issues templating the manifest with ytt [...]. Had the following error:

ytt: Error: Overlaying data values (in following order: values.yml, load-balancer.yml, system-registry-values.yml, values.yml): Document on line values.yml:3: Map item (key 'system_domain') on line values.yml:4: Expected number of matched nodes to be 1, but was 0

the fix was to upgrade ytt to 0.28, which supports the library/ref thing

cppforlife commented 4 years ago

challenge is that it's part of generic code. should it be promoted into something more special? does it tie in with higher-level library "definition" (like go.mod)?