Commit 4d388020 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #39895 from ncdc/fix-allow-missing-template-keys-test

Automatic merge from submit-queue (batch tested with PRs 38427, 39896, 39889, 39871, 39895) Fix expected error text I had initially coded the expected text to match what was coming out of stderr, which was wrong. This makes it match against what comes from stdout.
parents 887144c6 cb39d0d8
......@@ -1064,11 +1064,11 @@ run_kubectl_get_tests() {
## check --allow-missing-template-keys=false results in an error for a missing key with jsonpath
output_message=$(! kubectl get pod valid-pod --allow-missing-template-keys=false -o jsonpath='{.missing}' "${kube_flags[@]}")
kube::test::if_has_string "${output_message}" 'error executing jsonpath "{.missing}": missing is not found'
kube::test::if_has_string "${output_message}" 'missing is not found'
## check --allow-missing-template-keys=false results in an error for a missing key with go
output_message=$(! kubectl get pod valid-pod --allow-missing-template-keys=false -o go-template='{{.missing}}' "${kube_flags[@]}")
kube::test::if_has_string "${output_message}" 'error executing template "{{.missing}}": template: output:1:2: executing "output" at <.missing>: map has no entry for key "missing"'
kube::test::if_has_string "${output_message}" 'map has no entry for key "missing"'
# cleanup
kubectl delete pods valid-pod "${kube_flags[@]}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment