dyff
dyff copied to clipboard
Exclude for labels/annotations with slashes and dots in them
If you have the following:
kind: Deployment
metadata:
annotations:
test.io/tracking-id: atestinstance-001
labels:
app.kubernetes.io/instance: atestinstance001
How do you use exclude with this? Just doing metadata.labels does exclude all the labels but the . and / characters seem to cause issues with the exclude logic being able to identify the label.
Needed the same and after some trial and error, looking at issues, and looking at ytbx source... you can use the slash notation: /metadata/labels/app.kubernetes.io/instance. It seems to work even when there's a / in the key.