mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Fix shellcheck failures in test/cmd/d.*.sh
This commit is contained in:
parent
835552ecb6
commit
3a344c7168
@ -18,7 +18,5 @@
|
||||
./hack/lib/test.sh
|
||||
./hack/test-integration.sh
|
||||
./hack/verify-test-featuregates.sh
|
||||
./test/cmd/diff.sh
|
||||
./test/cmd/discovery.sh
|
||||
./test/cmd/legacy-script.sh
|
||||
./test/images/image-util.sh
|
||||
|
@ -48,7 +48,7 @@ run_kubectl_diff_same_names() {
|
||||
create_and_use_new_namespace
|
||||
kube::log::status "Test kubectl diff with multiple resources with the same name"
|
||||
|
||||
output_message=$(KUBECTL_EXTERNAL_DIFF=find kubectl diff -Rf hack/testdata/diff/)
|
||||
output_message=$(KUBECTL_EXTERNAL_DIFF="find" kubectl diff -Rf hack/testdata/diff/)
|
||||
kube::test::if_has_string "${output_message}" 'v1\.Pod\..*\.test'
|
||||
kube::test::if_has_string "${output_message}" 'apps\.v1\.Deployment\..*\.test'
|
||||
kube::test::if_has_string "${output_message}" 'v1\.ConfigMap\..*\.test'
|
||||
|
@ -30,11 +30,11 @@ run_RESTMapper_evaluation_tests() {
|
||||
### Non-existent resource type should give a recognizeable error
|
||||
# Pre-condition: None
|
||||
# Command
|
||||
kubectl get "${kube_flags[@]}" unknownresourcetype 2>${RESTMAPPER_ERROR_FILE} || true
|
||||
kubectl get "${kube_flags[@]:?}" unknownresourcetype 2>"${RESTMAPPER_ERROR_FILE}" || true
|
||||
if grep -q "the server doesn't have a resource type" "${RESTMAPPER_ERROR_FILE}"; then
|
||||
kube::log::status "\"kubectl get unknownresourcetype\" returns error as expected: $(cat ${RESTMAPPER_ERROR_FILE})"
|
||||
kube::log::status "\"kubectl get unknownresourcetype\" returns error as expected: $(cat "${RESTMAPPER_ERROR_FILE}")"
|
||||
else
|
||||
kube::log::status "\"kubectl get unknownresourcetype\" returns unexpected error or non-error: $(cat ${RESTMAPPER_ERROR_FILE})"
|
||||
kube::log::status "\"kubectl get unknownresourcetype\" returns unexpected error or non-error: $(cat "${RESTMAPPER_ERROR_FILE}")"
|
||||
exit 1
|
||||
fi
|
||||
rm "${RESTMAPPER_ERROR_FILE}"
|
||||
@ -121,9 +121,9 @@ run_swagger_tests() {
|
||||
# Verify schema
|
||||
file="${KUBE_TEMP}/schema.json"
|
||||
curl -s "http://127.0.0.1:${API_PORT}/openapi/v2" > "${file}"
|
||||
[[ "$(grep "list of returned" "${file}")" ]]
|
||||
[[ "$(grep "List of services" "${file}")" ]]
|
||||
[[ "$(grep "Watch for changes to the described resources" "${file}")" ]]
|
||||
grep -q "list of returned" "${file}"
|
||||
grep -q "List of services" "${file}"
|
||||
grep -q "Watch for changes to the described resources" "${file}"
|
||||
|
||||
set +o nounset
|
||||
set +o errexit
|
||||
|
Loading…
Reference in New Issue
Block a user