fix shellcheck failures

update pull request

update pull request
This commit is contained in:
aaa
2019-04-20 01:03:02 -04:00
parent 33f907a4df
commit 5c8ec1ce9c
3 changed files with 4 additions and 5 deletions

View File

@@ -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