Open NierYYDS opened 5 months ago
consider using jsonpatch
>>> src = {'foo': 'bar', 'numbers': [1, 3, 4, 8]}
>>> dst = {'baz': 'qux', 'numbers': [1, 4, 7]}
>>> patch = jsonpatch.JsonPatch.from_diff(src, dst)
# or equivalently
>>> patch = jsonpatch.make_patch(src, dst)
containers data in pod spec has a lot of key/values which has nothing to do with image replacement.
here is the contaienrs data examples, this webhook only change the image in each container.
the code to generate this jsonpatch will return all of the containers data, but I just need the diff data of image.