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

fix: skip remote Kustomizations on recursive diff #5071

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

milas
Copy link

@milas milas commented Nov 12, 2024

When recursively diffing Kustomization objects on a cluster, each Kustomization is built and then a server-side dry-run apply is performed. This isn't practical to perform if the Kustomization references a remote cluster via kubeConfig.secretRef.

Currently, because it's not skipped, it's treated as though it's being applied to the context cluster, not the remote cluster, which results in an incorrect diff.

Instead, write out special message / warnings indicating that it has been skipped:

► Kustomization/my-ns/my-kst skipped: diff not supported for remote clusters

See also:

@milas
Copy link
Author

milas commented Nov 12, 2024

FYI I did not make this return an error code. I think there's three reasonable options:

  • Leave as-is in this PR -> it's a warning only, no change to exit code
  • Overload createdOrDrifted to be "created or drifted or skipped"
  • Make it a hard error -> personally, I'd want a CLI flag to then ignore it 🫤

When recursively diffing Kustomization objects on a cluster, each
Kustomization is built and then a server-side dry-run apply is
performed. This isn't practical to perform if the Kustomization
references a remote cluster via `kubeConfig.secretRef`.

Currently, because it's not skipped, it's treated as though it's
being applied to the context cluster, not the remote cluter, which
results in an incorrect diff.

Instead, write out special message / warnings indicating that it
has been skipped:
```
► Kustomization/my-ns/my-kst skipped: diff not supported for remote clusters
```

Signed-off-by: Milas Bowman <[email protected]>
@milas milas force-pushed the diff-kustomization-recursive-remote branch from 74aabc7 to d7a2ffc Compare November 13, 2024 15:13
@stefanprodan stefanprodan added the area/diff Diff related issues and pull requests label Nov 14, 2024
@stefanprodan
Copy link
Member

@milas can you please rebase with upstream main and force push. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/diff Diff related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants