Merge pull request #122769 from thockin/bump_shellcheck_version

Bump shellcheck to 0.9.0
This commit is contained in:
Kubernetes Prow Robot
2024-02-05 08:45:29 -08:00
committed by GitHub
10 changed files with 37 additions and 74 deletions

View File

@@ -328,6 +328,17 @@ setup() {
kube::log::status "Setup complete"
}
# Generate a random namespace name, based on the current time (to make
# debugging slightly easier) and a random number. Don't use `date +%N`
# because that doesn't work on OSX.
create_and_use_new_namespace() {
local ns_name
ns_name="namespace-$(date +%s)-${RANDOM}"
kube::log::status "Creating namespace ${ns_name}"
kubectl create namespace "${ns_name}"
kubectl config set-context "${CONTEXT}" --namespace="${ns_name}"
}
# Runs all kubectl tests.
# Requires an env var SUPPORTED_RESOURCES which is a comma separated list of
# resources for which tests should be run.
@@ -341,17 +352,6 @@ runTests() {
kube::log::status "Checking kubectl version"
kubectl version
# Generate a random namespace name, based on the current time (to make
# debugging slightly easier) and a random number. Don't use `date +%N`
# because that doesn't work on OSX.
create_and_use_new_namespace() {
local ns_name
ns_name="namespace-$(date +%s)-${RANDOM}"
kube::log::status "Creating namespace ${ns_name}"
kubectl create namespace "${ns_name}"
kubectl config set-context "${CONTEXT}" --namespace="${ns_name}"
}
kube_flags=( '-s' "https://127.0.0.1:${SECURE_API_PORT}" '--insecure-skip-tls-verify' )
kube_flags_without_token=( "${kube_flags[@]}" )

View File

@@ -18,6 +18,7 @@ set -o nounset
set -o pipefail
# Shutdown the tests gracefully then save the results
# shellcheck disable=SC2317 # false positive
shutdown () {
E2E_SUITE_PID=$(pgrep e2e.test)
echo "sending TERM to ${E2E_SUITE_PID}"
@@ -41,7 +42,7 @@ saveResults() {
if [[ -n ${E2E_USE_GO_RUNNER:-} ]]; then
set -x
/gorunner && ret=0 || ret=$?
exit ${ret}
exit "${ret}"
fi
# We get the TERM from kubernetes and handle it gracefully
@@ -74,4 +75,4 @@ set -x
/usr/local/bin/ginkgo "${ginkgo_args[@]}" /usr/local/bin/e2e.test -- --disable-log-dump --repo-root=/kubernetes --provider="${E2E_PROVIDER}" --report-dir="${RESULTS_DIR}" --kubeconfig="${KUBECONFIG}" -v="${E2E_VERBOSITY}" > >(tee "${RESULTS_DIR}"/e2e.log) && ret=0 || ret=$?
set +x
saveResults
exit ${ret}
exit "${ret}"

View File

@@ -39,6 +39,6 @@ fi
# Running locally.
for ((i=0; i < ${#ARGS[@]}; i++)); do
ARGS[$i]="$(echo "${ARGS[$i]}" | sed -e 's/\[/\\\[/g' -e 's/\]/\\\]/g' )"
ARGS[i]="$(echo "${ARGS[$i]}" | sed -e 's/\[/\\\[/g' -e 's/\]/\\\]/g' )"
done
"${KUBE_ROOT}/hack/ginkgo-e2e.sh" "--e2e-verify-service-account=false" "--dump-logs-on-failure=false" "${ARGS[@]}"