-
Notifications
You must be signed in to change notification settings - Fork 614
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
Preview local changes with flux build/diff kustomization #2167
Conversation
5665027
to
bea283c
Compare
@souleb we should mask only the secret values encrypted with SOPS. I propose we change the mask to |
c09ae5f
to
e54cddf
Compare
7e5574d
to
8719769
Compare
594d3e3
to
70325ed
Compare
@stefanprodan my test diffing on plain kubernetes secrets always show changes in all values, when a secret is drifted. That's because the Can we have different mask only if the underlying value is different? |
8ecb583
to
5b89963
Compare
This is no longer a draft. It can be thoroughly tested by humans 😸 |
@souleb can you please update the PR description with up to date examples, I don't see any labels in the build output, if that's the case then this is a bug, as build should add the ownership labels to all objects. |
Yes going to update that.
Is it? We set the ownership label just before the dry-run in the diff command. It never appears in the output. flux2/internal/kustomization/diff.go Line 61 in b6c42b6
|
@souleb the build command should have the same output as in the controller. |
b6c42b6
to
b4d6bc4
Compare
The labels now appear in the build. |
b4d6bc4
to
88cddfb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this work, I have similar interests and had done PoC, before finding this, I left 2 comments... My other concern is there a plan to ensure the logic here stays in sync with the Reconcile
and finalize
methods from the kustomize-controller...
709b0dd
to
4eec2f6
Compare
4eec2f6
to
0547df8
Compare
@souleb I found several bugs in the dry-run, it doesn't ignore objects with |
@souleb please update ssa to |
0547df8
to
a24a48e
Compare
If implemented it will permit queriying the Kubernetes API to fetch the specified Flux Kustomization, then uses the specified path to build the overlay. Signed-off-by: Soule BA <soule@weave.works>
If implemented it will permit queriying the Kubernetes API to fetch the specified Flux Kustomization, then uses the specified path to build the overlay. It will then ssa-dry-run apply and output the diff using homeport/dyff Signed-off-by: Soule BA <soule@weave.works>
Signed-off-by: Soule BA <soule@weave.works>
a24a48e
to
35a0af5
Compare
@souleb I've run the latest commit and works fine now on my test cluster. Tested this with all sorts of edits, I think we can release this as an "experimental" feature. |
If implemented this permit restoring a clean state in case of signal interruption. Signed-off-by: Soule BA <soule@weave.works>
35a0af5
to
306f8f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @souleb 🥇
Signed-off-by: Soule BA soule@weave.works
fixes #2142
Allow users to preview changes to their Kustomize overlays without committing changes to upstream
The diff output is formatted with https://github.com/homeport/dyff
Tests
build kustomization
With the following tree:
and a kustomization:
The build command renders:
We sanitize the multi-doc yaml before printing, it. Every value of the
data object
insecrets
are base64 decoded, and if it'ssops
data, we replace the whole value with a mask.Test diff kustomization