mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +00:00
Merge pull request #53796 from lichuqiang/kubectl_fix_1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix print format of rootScoped resourced in kubectl **What this PR does / why we need it**: remove _NAMESPACE_ filed when querying rootScoped resource with kubectl **Which issue this PR fixes** fixes #53767 **Special notes for your reviewer**: /cc @smarterclayton **Release note**: ```release-note NONE ```
This commit is contained in:
@@ -4218,6 +4218,14 @@ run_kubectl_all_namespace_tests() {
|
||||
# Post-condition: valid-pod doesn't exist
|
||||
kube::test::get_object_assert pods "{{range.items}}{{$id_field}}:{{end}}" ''
|
||||
|
||||
### Verify flag all-namespaces is ignored for rootScoped resources
|
||||
# Pre-condition: node exists
|
||||
kube::test::get_object_assert nodes "{{range.items}}{{$id_field}}:{{end}}" '127.0.0.1:'
|
||||
# Command
|
||||
output_message=$(kubectl get nodes --all-namespaces 2>&1)
|
||||
# Post-condition: output with no NAMESPACE field
|
||||
kube::test::if_has_not_string "${output_message}" "NAMESPACE"
|
||||
|
||||
set +o nounset
|
||||
set +o errexit
|
||||
}
|
||||
@@ -4907,7 +4915,9 @@ runTests() {
|
||||
############################
|
||||
|
||||
if kube::test::if_supports_resource "${pods}" ; then
|
||||
record_command run_kubectl_all_namespace_tests
|
||||
if kube::test::if_supports_resource "${nodes}" ; then
|
||||
record_command run_kubectl_all_namespace_tests
|
||||
fi
|
||||
fi
|
||||
|
||||
################
|
||||
|
Reference in New Issue
Block a user