Closed Birdrock closed 3 years ago
Hi @Birdrock,
The #@overlay/remove
action will match and remove the node on the left side (values-defaults.yml), based on the right side (values-production.yml). Since it looks like you deleted the keys:
map and its children in values-defaults.yml, the #@overlay/remove
action in your overlay will not match any nodes in values-defaults.yml, thus no action will be taken. If you want the result:
keys:
key2: val2-new
key3: val3
names:
- production.example.com
then you could simply delete the #@overlay/remove ... key1:
from the values-production.yml.
Let me know if this makes sense to you; I'm happy to try and answer any further questions you have.
Hey @Birdrock, did @gcheadle-vmware's comment above resolve your issue?
per related slack thread...
we have an item in https://github.com/vmware-tanzu/carvel-ytt/issues/112
traverse value for merge/replace/append/insert (since they may include overlay directives) when short circuiting
that would solve this problem. in summary, ytt should not interpret chunk of yaml as plain yaml once it decided that key is missing and it needs to add chunk of yaml. instead it should interpret it as an overlay which would account for annotations such as overlay/remove.
Note: referred to Slack thread = https://kubernetes.slack.com/archives/CH8KCCKA5/p1617742603193700
So, I'm reading:
@overlay/remove
's case, the expectation is that it never contributes a fragment of YAML... but it does so today as described above.For the first part: looks resolved. As such, I'll close this issue.
For the second part: #112 is effectively an Epic... before we migrated to ZenHub.
I'll:
@Birdrock I think this part mates up with your expectations of how the feature should work.
:+1:
For those keeping score at home, tracking this class of symptoms as a "bug" first reported in #308.
The work to fix this is in #371.
What steps did you take: Modified the ytt playground example-multiple-data-values as follows:
config.yml
values-defaults.yml
values-production.yml
What happened:
keys.key1
was inserted with a null value despite#@overlay/remove
.What did you expect:
Environment:
ytt --version
):ytt version 0.31.0
/etc/os-release
):