mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-28 21:55:48 +00:00
Merge pull request #42369 from smarterclayton/get_warning
Automatic merge from submit-queue Output of `kubectl get` is inconsistent for pods Builds on top of fixes from #42283, only the last two commits are new. Reverts behavior of #39042 which was inconsistent and confusing. Fixes #15853
This commit is contained in:
@@ -76,7 +76,7 @@ kube::test::object_assert() {
|
||||
local args=${5:-}
|
||||
|
||||
for j in $(seq 1 ${tries}); do
|
||||
res=$(eval kubectl get "${kube_flags[@]}" ${args} $object -o go-template=\"$request\")
|
||||
res=$(eval kubectl get -a "${kube_flags[@]}" ${args} $object -o go-template=\"$request\")
|
||||
if [[ "$res" =~ ^$expected$ ]]; then
|
||||
echo -n ${green}
|
||||
echo "$(kube::test::get_caller 3): Successful get $object $request: $res"
|
||||
@@ -103,7 +103,7 @@ kube::test::get_object_jsonpath_assert() {
|
||||
local request=$2
|
||||
local expected=$3
|
||||
|
||||
res=$(eval kubectl get "${kube_flags[@]}" $object -o jsonpath=\"$request\")
|
||||
res=$(eval kubectl get -a "${kube_flags[@]}" $object -o jsonpath=\"$request\")
|
||||
|
||||
if [[ "$res" =~ ^$expected$ ]]; then
|
||||
echo -n ${green}
|
||||
|
@@ -1106,6 +1106,10 @@ run_kubectl_get_tests() {
|
||||
# Post-condition: The text "No resources found" should be part of the output
|
||||
kube::test::if_has_string "${output_message}" 'No resources found'
|
||||
# Command
|
||||
output_message=$(kubectl get pods --ignore-not-found 2>&1 "${kube_flags[@]}")
|
||||
# Post-condition: The text "No resources found" should not be part of the output
|
||||
kube::test::if_has_not_string "${output_message}" 'No resources found'
|
||||
# Command
|
||||
output_message=$(kubectl get pods 2>&1 "${kube_flags[@]}" -o wide)
|
||||
# Post-condition: The text "No resources found" should be part of the output
|
||||
kube::test::if_has_string "${output_message}" 'No resources found'
|
||||
|
Reference in New Issue
Block a user