From 5c8ec1ce9c7ae01d70c89c057a60617758cca791 Mon Sep 17 00:00:00 2001 From: aaa <1693291525@qq.com> Date: Sat, 20 Apr 2019 01:03:02 -0400 Subject: [PATCH] fix shellcheck failures update pull request update pull request --- hack/.shellcheck_failures | 1 - hack/verify-openapi-spec.sh | 2 +- hack/verify-test-featuregates.sh | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index f7fa9e1274..5f18a50847 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -42,7 +42,6 @@ ./hack/verify-codegen.sh ./hack/verify-golint.sh ./hack/verify-no-vendor-cycles.sh -./hack/verify-test-featuregates.sh ./test/cmd/apply.sh ./test/cmd/apps.sh ./test/cmd/authorization.sh diff --git a/hack/verify-openapi-spec.sh b/hack/verify-openapi-spec.sh index 6965a6754e..92d4ee883f 100755 --- a/hack/verify-openapi-spec.sh +++ b/hack/verify-openapi-spec.sh @@ -32,7 +32,7 @@ _tmp="${KUBE_ROOT}/_tmp" mkdir -p "${_tmp}" cp -a "${SPECROOT}" "${TMP_SPECROOT}" -trap 'cp -a "${TMP_SPECROOT}" "${SPECROOT}"/..; rm -rf "${_tmp}"' EXIT SIGINT +trap 'cp -a ${TMP_SPECROOT} ${SPECROOT}/..; rm -rf ${_tmp}' EXIT SIGINT rm "${SPECROOT}"/* cp "${TMP_SPECROOT}/BUILD" "${SPECROOT}/BUILD" cp "${TMP_SPECROOT}/README.md" "${SPECROOT}/README.md" diff --git a/hack/verify-test-featuregates.sh b/hack/verify-test-featuregates.sh index e801cc5342..12175f0472 100755 --- a/hack/verify-test-featuregates.sh +++ b/hack/verify-test-featuregates.sh @@ -18,7 +18,7 @@ set -o errexit set -o nounset set -o pipefail -KUBE_ROOT=$(dirname "${BASH_SOURCE}")/.. +KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. source "${KUBE_ROOT}/hack/lib/init.sh" cd "${KUBE_ROOT}" @@ -26,7 +26,7 @@ cd "${KUBE_ROOT}" rc=0 # find test files accessing the mutable global feature gate or interface -direct_sets=$(grep -n --include *_test.go -R 'MutableFeatureGate' . 2>/dev/null) || true +direct_sets=$(grep -n --include './*_test.go' -R 'MutableFeatureGate' . 2>/dev/null) || true if [[ -n "${direct_sets}" ]]; then echo "Test files may not access mutable global feature gates directly:" >&2 echo "${direct_sets}" >&2 @@ -38,7 +38,7 @@ if [[ -n "${direct_sets}" ]]; then fi # find test files calling SetFeatureGateDuringTest and not calling the result -missing_defers=$(grep -n --include *_test.go -R 'SetFeatureGateDuringTest' . 2>/dev/null | egrep -v "defer .*\\)\\(\\)$") || true +missing_defers=$(grep -n --include './*_test.go' -R 'SetFeatureGateDuringTest' . 2>/dev/null | grep -E -v "defer .*\\)\\(\\)$") || true if [[ -n "${missing_defers}" ]]; then echo "Invalid invocations of utilfeaturetesting.SetFeatureGateDuringTest():" >&2 echo "${missing_defers}" >&2