feat: Add namespace support to resources_create_or_update as in kubectl apply -n namespace#1135
Open
ash-thakur-rh wants to merge 1 commit into
Open
Conversation
Signed-off-by: Ashish Thakur <ashishth@redhat.com>
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.
Closes: #536
Root Cause
The
resourceparameter description inpkg/toolsets/core/resources.goonly said:No mention of
metadata.namespaceor default namespace fallback behavior.Changes
1. Tool description update
File:
pkg/toolsets/core/resources.go:102Updated the
resourceparameter description to include namespace guidance:2. Test proving non-default namespace is respected
File:
pkg/mcp/resources_test.goAdded subtest
resources_create_or_update respects namespace from resource metadatainsideTestResourcesCreateOrUpdate. Existing tests all usednamespace: default, which coincides with the envtest default, they would pass even if namespace handling was broken.The new test:
metadata.namespace: ns-1(a non-default namespace already set up incommon_test.go:136)ns-1with the correct namespace valuedefault, proving the namespace was not silently ignoredReferences