dyff icon indicating copy to clipboard operation
dyff copied to clipboard

Exclude for labels/annotations with slashes and dots in them

Open kevspl opened this issue 1 year ago • 1 comments

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.

kevspl avatar Apr 23 '24 20:04 kevspl

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.

valorl avatar Apr 14 '25 12:04 valorl