diff --git a/hack/.shellcheck_failures b/hack/.shellcheck_failures index fda3abbbb2b..ce657a638ab 100644 --- a/hack/.shellcheck_failures +++ b/hack/.shellcheck_failures @@ -17,5 +17,4 @@ ./cluster/validate-cluster.sh ./hack/lib/test.sh ./hack/test-integration.sh -./hack/verify-test-featuregates.sh ./test/images/image-util.sh diff --git a/hack/verify-test-featuregates.sh b/hack/verify-test-featuregates.sh index aab2fd8459e..9de17ef58c3 100755 --- a/hack/verify-test-featuregates.sh +++ b/hack/verify-test-featuregates.sh @@ -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=$(find -L . -name '*_test.go' -exec grep -Hn '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 | grep -E -v "defer .*\\)\\(\\)$") || true +missing_defers=$(find -L . -name '*_test.go' -exec grep -Hn 'SetFeatureGateDuringTest' {} \; 2>/dev/null | grep -E -v "defer .*\\)\\(\\)$") || true if [[ -n "${missing_defers}" ]]; then echo "Invalid invocations of featuregatetesting.SetFeatureGateDuringTest():" >&2 echo "${missing_defers}" >&2