diff should skip empty config values, as api won't return them
jjo opened this issue · comments
JuanJo Ciarlante commented
Example from creating a pod from scratch (note empty env
):
$ cat nginx.pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
env: []
name: nginx
restartPolicy: Never
$ kubecfg update -v nginx.pod.yaml
INFO Updating pods nginx
INFO Creating non-existent pods nginx
$ kubecfg diff --diff-strategy subset nginx.pod.yaml
---
- live pods nginx
+ config pods nginx
{
"apiVersion": "v1",
"kind": "Pod",
"metadata": {
"labels": {
"run": "nginx"
},
"name": "nginx"
},
"spec": {
"containers": [
{
"image": "nginx",
"imagePullPolicy": "IfNotPresent",
"name": "nginx",
"resources": {
}
+ "env": [
+ ]
}
],
"dnsPolicy": "ClusterFirst",
"restartPolicy": "Never"
}
}
ERROR Differences found.
JuanJo Ciarlante commented
FYI using kubecfg
built from PR #180:
$ ./kubecfg diff --diff-strategy subset nginx.pod.yaml
---
- live pods nginx
+ config pods nginx
pods nginx unchanged