Commit 2260cc29 authored by Xiangyang Chu's avatar Xiangyang Chu Committed by Xiangyang Chu

Make test/cmd/a*.sh pass shellcheck

parent 7289c1e9
......@@ -33,9 +33,6 @@
./hack/update-vendor.sh
./hack/verify-golint.sh
./hack/verify-test-featuregates.sh
./test/cmd/apply.sh
./test/cmd/apps.sh
./test/cmd/authorization.sh
./test/cmd/batch.sh
./test/cmd/certificate.sh
./test/cmd/core.sh
......
......@@ -59,21 +59,21 @@ run_impersonation_tests() {
kube::log::status "Testing impersonation"
output_message=$(! kubectl get pods "${kube_flags_with_token[@]}" --as-group=foo 2>&1)
output_message=$(! kubectl get pods "${kube_flags_with_token[@]:?}" --as-group=foo 2>&1)
kube::test::if_has_string "${output_message}" 'without impersonating a user'
if kube::test::if_supports_resource "${csr}" ; then
if kube::test::if_supports_resource "${csr:?}" ; then
# --as
kubectl create -f hack/testdata/csr.yml "${kube_flags_with_token[@]}" --as=user1
kubectl create -f hack/testdata/csr.yml "${kube_flags_with_token[@]:?}" --as=user1
kube::test::get_object_assert 'csr/foo' '{{.spec.username}}' 'user1'
kube::test::get_object_assert 'csr/foo' '{{range .spec.groups}}{{.}}{{end}}' 'system:authenticated'
kubectl delete -f hack/testdata/csr.yml "${kube_flags_with_token[@]}"
kubectl delete -f hack/testdata/csr.yml "${kube_flags_with_token[@]:?}"
# --as-group
kubectl create -f hack/testdata/csr.yml "${kube_flags_with_token[@]}" --as=user1 --as-group=group2 --as-group=group1 --as-group=,,,chameleon
kubectl create -f hack/testdata/csr.yml "${kube_flags_with_token[@]:?}" --as=user1 --as-group=group2 --as-group=group1 --as-group=,,,chameleon
kube::test::get_object_assert 'csr/foo' '{{len .spec.groups}}' '3'
kube::test::get_object_assert 'csr/foo' '{{range .spec.groups}}{{.}} {{end}}' 'group2 group1 ,,,chameleon '
kubectl delete -f hack/testdata/csr.yml "${kube_flags_with_token[@]}"
kubectl delete -f hack/testdata/csr.yml "${kube_flags_with_token[@]:?}"
fi
set +o nounset
......
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