Merge pull request #76843 from xichengliudui/fixshellcheckfailures-27

Fix shellcheck failures on verify-readonly-packages.sh
k3s-v1.15.3
Kubernetes Prow Robot 2019-04-19 13:51:55 -07:00 committed by GitHub
commit 746fea0428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -47,7 +47,6 @@
./hack/verify-golint.sh
./hack/verify-no-vendor-cycles.sh
./hack/verify-openapi-spec.sh
./hack/verify-readonly-packages.sh
./hack/verify-test-featuregates.sh
./test/cmd/apply.sh
./test/cmd/apps.sh

View File

@ -22,7 +22,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"
readonly branch=${1:-${KUBE_VERIFY_GIT_BRANCH:-master}}
@ -44,12 +44,17 @@ find_files() {
}
IFS=$'\n'
conflicts=($(find_files | sed 's|/.readonly||' | while read dir; do
conflicts=()
while IFS=$'\n' read -r line; do
conflicts+=( "$line" )
done < <(find_files | sed 's|/.readonly||' | while read -r dir; do
dir=${dir#./}
if kube::util::has_changes "${branch}" "^${dir}/[^/]*\$" '/\.readonly$|/BUILD$|/zz_generated|/\.generated\.|\.proto$|\.pb\.go$' >/dev/null; then
echo "${dir}"
fi
done))
done)
unset IFS
if [ ${#conflicts[@]} -gt 0 ]; then