Skip to content

Commit eb0e064

Browse files
committed
Fix shellcheck failures in hack/verify-test-featuregates.sh
1 parent 9743d7f commit eb0e064

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

hack/.shellcheck_failures

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@
1717
./cluster/validate-cluster.sh
1818
./hack/lib/test.sh
1919
./hack/test-integration.sh
20-
./hack/verify-test-featuregates.sh
2120
./test/images/image-util.sh

hack/verify-test-featuregates.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ cd "${KUBE_ROOT}"
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=$(find -L . -name '*_test.go' -exec grep -Hn '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 | grep -E -v "defer .*\\)\\(\\)$") || true
41+
missing_defers=$(find -L . -name '*_test.go' -exec grep -Hn 'SetFeatureGateDuringTest' {} \; 2>/dev/null | grep -E -v "defer .*\\)\\(\\)$") || true
4242
if [[ -n "${missing_defers}" ]]; then
4343
echo "Invalid invocations of featuregatetesting.SetFeatureGateDuringTest():" >&2
4444
echo "${missing_defers}" >&2

0 commit comments

Comments
 (0)