Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flux diff could provide an inline diff for large configmap entries #2400

Closed
1 task done
rombert opened this issue Feb 7, 2022 · 6 comments · Fixed by #2584
Closed
1 task done

flux diff could provide an inline diff for large configmap entries #2400

rombert opened this issue Feb 7, 2022 · 6 comments · Fixed by #2584
Assignees
Labels
enhancement New feature or request

Comments

@rombert
Copy link

rombert commented Feb 7, 2022

Describe the bug

First of all, thanks for the rapid fixes around the flux diff and flux build commands.

I ran into a case in which I think the flux diff command could be even more useful. It is sometimes the case that configmap entries hold entire configuration files in formats like YAML or JSON. A one-line change in a large file is now shown by flux diff as a complete change of the whole key, which makes it hard to identify the exact line that has changed.

Steps to reproduce

  1. Include a configmap with a single large key in a kustomization
  2. Deploy the kustomization with flux
  3. Make a small change to the configmap locally, without pushinf
  4. Run flux diff

Expected behavior

The change should displayed inline, perhaps in the unified diff format.

Screenshots and recordings

No response

OS / Distro

openSUSE Tumbleweed

Flux version

v0.26.2

Flux check

► checking prerequisites
✔ Kubernetes 1.22.5 >=1.20.6-0
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v0.16.0
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v0.20.0
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v0.21.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v0.21.1
✔ all checks passed

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@pjbgf pjbgf added the enhancement New feature or request label Feb 17, 2022
@kingdonb
Copy link
Member

We've just come across this at the Flux Bug Scrub and we're in agreement this would be a useful feature!

@souleb
Copy link
Member

souleb commented Mar 29, 2022

@rombert please test this and reopen if needed.

@rombert
Copy link
Author

rombert commented Mar 29, 2022

@souleb - is there a snapshot build I could use for testing?

@stefanprodan
Copy link
Member

@rombert you can clone this repo then do make build then run ./bin/flux diff.

@rombert
Copy link
Author

rombert commented Apr 1, 2022

Thanks @souleb and @stefanprodan . I can confirm that the behaviour is much improved. I've attached a screenshot. I personally would prefer a unified diff format or some other format which trims unnecessary context, but this is good enough for now

image

@souleb
Copy link
Member

souleb commented Apr 1, 2022

Awesome! Thank you. I would like to add an unified diff format too, but it requires time to implement it. Maybe some time in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants