-
Notifications
You must be signed in to change notification settings - Fork 104
Container changes inDeployment
=> "element [0] missing"
#37
Comments
We can, by teaching kubediff to sort certain lists e.g. |
is there an update on this? or a workaround? |
Getting the same issue. An update would be awesome. Thanks for |
I've coded a workaround for this. It's far from perfect because tests are broken and all but that fits my needs. Looks interesting to share anyway. My understanding is that after the change #31 every change in any deep after a list results in 'element[X] missing' issue we are talking about. Hence if you change the image of a container (the most likely on a daily change), you have this issue, making the tool quite useless imho. The change make sense in a way that if you remove or add element in a list from running or wished configuration, differences between elements get mixed up and you end up with an horrible diff output e.g.: you remove wished var1 then running var1 is diffed with wished var2, running var2 is diffed with wished var3 and so on... Luckily changes not happening much except for environment variable list. I then did the following change. Reverted the old behavior for list having same size, and if not return 'element missing' except for .spec.template.spec.containers[X].env whish have a special treat. Let's say you running on this
and want this:
With my hack, kubediff output is:
Patch is attached. Edit kubedifflib/_diff.py and build container with build instructions in doc except "make .uptodate" instead of "make" to bypass tests. |
- Dockerfile freshen: fresher kubectl version and alpine base image (weaveworks#79) - Makefile modified to build and push on Mirakl registry - Display differences on containers subfields (weaveworks#37)
- Dockerfile freshen: fresher kubectl version and alpine base image (weaveworks#79) - Makefile modified to build and push on Mirakl registry - Display differences on containers subfields and env var diff especially (weaveworks#37) - Add key missing in wished configuration for .metadata.labels only - Update build instructions
- Dockerfile freshen: fresher kubectl version and alpine base image (weaveworks#79) - Makefile modified to build and push on Mirakl registry - Display differences on containers subfields and env var diff especially (weaveworks#37) - Add key missing in wished configuration for .metadata.labels only - Update build instructions
Any update here? I have to imagine comparing changes to containers is pretty crucial to most people's use cases. |
Trying kubediff for the first time and I get this on an array inside one of the values for my HelmRelease. Eg:
With the following HelmRelease:
Here's the resource in the cluster
|
The patch from @damienleger works great. thanks |
@damienleger I have downloaded the kubediff repo and using the Even after that I am still getting the similar issues. As per your comment "build container with build instructions in doc except "make .uptodate" instead of "make" to bypass tests." Could you please share the link of the document which you are referring? |
hello @gouravsw, tbh I've did that tweak for my previous job so I'm not working on this anymore. That being said, when referring to "doc" I meant this --> https://github.com/weaveworks/kubediff#build So by replacing
|
Using this
deployment.yaml
:If I change a field in the
containers
part, e.g. thecontainerPort
,kubediff
returns:The text was updated successfully, but these errors were encountered: