So I'm using dyff between as a KUBECTL_EXTERNAL_DIFF, and in general it works correctly like this:
❯ export KUBECTL_EXTERNAL_DIFF="dyff between -b "
❯ kubectl -n tools diff -f ./mongodb-cronjob.yaml
metadata.generation
± value change
- 24
+ 25
spec.jobTemplate.spec.template.spec.containers.mongo.image
± value change
- some/mongoimage:1.3.0
+ some/mongoimage:1.4.0
But I wanted to remove the metadata.generation changes, so I added an --exclude option. But then it fails to work:
❯ export KUBECTL_EXTERNAL_DIFF="dyff between -b --exclude 'metadata.generation'"
❯ kubectl -n tools diff -f ./mongodb-cronjob.yaml
╭ Error occurred
│ accepts 2 arg(s), received 1
╵
When I use it on that same yaml on disk, it works properly:
❯ dyff between -b --exclude "metadata.generation" mongo1.yaml mongo2.yaml
spec.jobTemplate.spec.template.spec.containers.mongo.image
± value change
- some/mongoimage:1.3.0
+ some/mongoimage:1.4.0
Testing
- dyff version 1.10.2
- macOS 15.7.1 ARM
- kubectl version
Client Version: v1.33.3
Kustomize Version: v5.6.0
Server Version: v1.32.8-gke.1170000
- I've tried a bunch of different escaping and quoting options for the exclude parameter, like
\"metadata.generation\" or "metadata.generation", but cannot remember all of them... 😬
Question
- Am I maybe breaking Kubernetes object detection with the
exclude option?
- Can I setup any debug mode that shows me the full command line
kubectl is passing to dyff ?
Adding the --v 9 verbose lebel to kubectl shows tracing and API calls, but not dyffcalls
- Am I missing something?
So I'm using
dyff betweenas a KUBECTL_EXTERNAL_DIFF, and in general it works correctly like this:But I wanted to remove the
metadata.generationchanges, so I added an--excludeoption. But then it fails to work:When I use it on that same yaml on disk, it works properly:
❯ dyff between -b --exclude "metadata.generation" mongo1.yaml mongo2.yaml spec.jobTemplate.spec.template.spec.containers.mongo.image ± value change - some/mongoimage:1.3.0 + some/mongoimage:1.4.0Testing
Client Version: v1.33.3
Kustomize Version: v5.6.0
Server Version: v1.32.8-gke.1170000
\"metadata.generation\"or"metadata.generation", but cannot remember all of them... 😬Question
excludeoption?kubectlis passing todyff?Adding the
--v 9verbose lebel tokubectlshows tracing and API calls, but notdyffcalls