Skip to content

Commit fd0a140

Browse files
authored
Merge pull request kubernetes#76890 from xichengliudui/fixshellcheckfailures-31
fix shellcheck failures on and verify-test-featuregates.sh
2 parents ccf9556 + 5c8ec1c commit fd0a140

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
./hack/verify-codegen.sh
4343
./hack/verify-golint.sh
4444
./hack/verify-no-vendor-cycles.sh
45-
./hack/verify-test-featuregates.sh
4645
./test/cmd/apply.sh
4746
./test/cmd/apps.sh
4847
./test/cmd/authorization.sh

hack/verify-openapi-spec.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ _tmp="${KUBE_ROOT}/_tmp"
3232

3333
mkdir -p "${_tmp}"
3434
cp -a "${SPECROOT}" "${TMP_SPECROOT}"
35-
trap 'cp -a "${TMP_SPECROOT}" "${SPECROOT}"/..; rm -rf "${_tmp}"' EXIT SIGINT
35+
trap 'cp -a ${TMP_SPECROOT} ${SPECROOT}/..; rm -rf ${_tmp}' EXIT SIGINT
3636
rm "${SPECROOT}"/*
3737
cp "${TMP_SPECROOT}/BUILD" "${SPECROOT}/BUILD"
3838
cp "${TMP_SPECROOT}/README.md" "${SPECROOT}/README.md"

hack/verify-test-featuregates.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21-
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
21+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2222
source "${KUBE_ROOT}/hack/lib/init.sh"
2323

2424
cd "${KUBE_ROOT}"
2525

2626
rc=0
2727

2828
# find test files accessing the mutable global feature gate or interface
29-
direct_sets=$(grep -n --include *_test.go -R 'MutableFeatureGate' . 2>/dev/null) || true
29+
direct_sets=$(grep -n --include './*_test.go' -R 'MutableFeatureGate' . 2>/dev/null) || true
3030
if [[ -n "${direct_sets}" ]]; then
3131
echo "Test files may not access mutable global feature gates directly:" >&2
3232
echo "${direct_sets}" >&2
@@ -38,7 +38,7 @@ if [[ -n "${direct_sets}" ]]; then
3838
fi
3939

4040
# find test files calling SetFeatureGateDuringTest and not calling the result
41-
missing_defers=$(grep -n --include *_test.go -R 'SetFeatureGateDuringTest' . 2>/dev/null | egrep -v "defer .*\\)\\(\\)$") || true
41+
missing_defers=$(grep -n --include './*_test.go' -R 'SetFeatureGateDuringTest' . 2>/dev/null | grep -E -v "defer .*\\)\\(\\)$") || true
4242
if [[ -n "${missing_defers}" ]]; then
4343
echo "Invalid invocations of utilfeaturetesting.SetFeatureGateDuringTest():" >&2
4444
echo "${missing_defers}" >&2

0 commit comments

Comments
 (0)