Repository navigation
Conversation
When building or diffing recursively, the spec of a nested Kustomization was read from the cluster, and the spec rendered from local sources was used only when the object did not exist. Changes made in Git to a nested Kustomization, such as patches or path, were not reflected in the output. Prefer the rendered spec and keep the live status, so pruning is still computed against the cluster inventory. Also reset the diff --local-sources flag between tests to avoid writing into a nil map. Signed-off-by: Sakıp Han Dursun <sakiphann@gmail.com> Assisted-by: Claude Code/claude-opus-5-5
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5294
When
flux diff ks --recursive, orflux build ks --recursivewithout--dry-run, processes a nested Kustomization that already exists in thecluster, the builder uses the spec of the live object. Local changes to the
nested Kustomization (patches, path, targetNamespace, postBuild) are ignored,
and the diff only reports the Kustomization object itself as drifted.
To answer the question in the issue:
--kustomization-fileworks for the rootKustomization, because the local spec takes precedence there. Nested
Kustomizations had no equivalent. With this change the spec rendered from local
sources takes precedence for them too, and the live status is kept, so pruning
is still computed against the cluster inventory.
The new tests build and diff a nested Kustomization whose local spec adds a
patch that the cluster copy does not have. The test reset of
diffKsArgs.localSourcesis also fixed: running two diff tests with--local-sourcespanicked on a nil map.