Closed mplzik closed 5 years ago
PTAL.
LGTM.
but sadly EMENOMAINTAINER of this repo; pinging my colleague @anguslees.
LGTM also, thanks @emempi -- verified it fixes false diff positives on numeric values, and much better handles e.g. configmap diffs with multiline valued fields.
The old code relied on gojsondiff library, which provides more semantic JSON diffs. This library, however, had some long-standing issues which have not been yet fixed, namely:
These sometimes resulted in diffs that were too noisy and/or showed false information; this has been reported as
https://github.com/ksonnet/kubecfg/issues/229
This patch reworks kubecfg's diff code to first marshal JSON using golang's encoding/json and then calculates the diff using diffmatchpatch library, formatting the output as close to the original as possible. Although this results in a more syntactic-level diff, it might just do the job until gojsondiff gets the above-mentioned bugs fixed.
Signed-off-by: Milan Plzik milan.plzik@ceai.io