allenporter/flux-local

Improve flux-local diff with a more compact diff

allenporter opened this issue · 2 comments

A common case for version bumps is to see a diff like this repeated many times:

---
@@ -110,10 +110,10 @@
   name: kube-prometheus-stack-grafana
   namespace: default
   labels:
-    helm.sh/chart: grafana-6.50.7
+    helm.sh/chart: grafana-6.51.2
     app.kubernetes.io/name: grafana
     app.kubernetes.io/instance: kube-prometheus-stack
-    app.kubernetes.io/version: "9.3.6"
+    app.kubernetes.io/version: "9.3.8"
     app.kubernetes.io/managed-by: Helm
 type: Opaque
 data:

with numerous copies of the same string over and over. It may be easier to wield as an object diff, something like:

MyObject
    helm.sh/chart: grafana-6.50.7 -> grafana-6.51.2
    app.kubernetes.io/version: "9.3.6" -> "9.3.8"
$ flux diff ks home --path home/prod/
✓  Kustomization diffing...
► HelmRelease/hajimari/hajimari drifted

metadata.generation
  ± value change
    - 10
    + 11

spec.chart.spec.version
  ± value change
    - 2.0.2
    + 2.0.1

It looks like flux is using https://github.com/homeport/dyff/ and so maybe instead of trying to re-create that the answer is to support an external diff deferring the output to the dyff cli.