Skip to content
This repository has been archived by the owner on Nov 17, 2021. It is now read-only.

diff should skip empty config values, as api won't return them #179

Closed
jjo opened this issue Dec 15, 2017 · 1 comment
Closed

diff should skip empty config values, as api won't return them #179

jjo opened this issue Dec 15, 2017 · 1 comment

Comments

@jjo
Copy link
Contributor

jjo commented Dec 15, 2017

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.  
@jjo
Copy link
Contributor Author

jjo commented Dec 15, 2017

FYI using kubecfg built from PR #180:

$ ./kubecfg diff --diff-strategy subset nginx.pod.yaml
---
- live pods nginx
+ config pods nginx
pods nginx unchanged

@jjo jjo changed the title diff should skip empty config values, as api won't return these diff should skip empty config values, as api won't return them Dec 15, 2017
anguslees pushed a commit that referenced this issue Dec 20, 2017
* [jjo] diff: handle empty config values #179
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant