Repository navigation
fix(simulate): ignore the namespace on cluster-scoped XR inputs - #518
Merged
Merged
Conversation
An explicit metadata.namespace on an XR whose XRD is Cluster or LegacyCluster scoped was kept, so the dynamic client looked the XR up at a namespaced URL, got a 404 and previewed it as new. The namespace also leaked into the report identity and could hide that two inputs are the same XR. kubectl apply ignores the namespace on a cluster-scoped object, so clear it, as the counterpart of the namespace defaulting for claims and Namespaced XRs. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jonathan Ogilvie <jonathan.ogilvie@sumologic.com>
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
haarchri
approved these changes
Nov 9, 2026
2 of 5 tasks
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.
Description of your changes
xr simulatekept an explicitmetadata.namespaceon an XR input whose XRD hasspec.scopeClusterorLegacyCluster. The dynamic client then looked the XR up at a namespaced URL, got a 404, and previewed it as new. The namespace also leaked into the report identity, and the input validator could miss that it was the same XR as an input given without a namespace.kubectl applyignores the namespace on a cluster-scoped object, so this clears it.This is the counterpart of the namespace defaulting from #487, which fills in a missing namespace for claims and Namespaced XRs. CodeRabbit raised it on #508.
Covered by new cases in
TestCheckCompositesNamespace: Cluster and LegacyCluster XRs with an explicit namespace come out with none, and a Namespaced XR keeps its explicit namespace. The namespace is dropped silently, askubectl applydrops it.I have:
RunRan./nix.sh flake checkto ensure this PR is ready for review.go test,go vetand./nix.sh run .#lintinstead.Linked a PR or a docs tracking issue to document this change.Bug fix; no documented behavior changes.AddedNot a backport candidate.backport release-x.ylabels to auto-backport this PR.Need help with this checklist? See the cheat sheet.
🤖 Generated with Claude Code