Skip to content

Commit

Permalink
Merge pull request kubernetes#77841 from liggitt/restore-verify-script
Browse files Browse the repository at this point in the history
Revert "fix shellcheck failures of hack/verify-no-vendor-cycles.sh"
  • Loading branch information
k8s-ci-robot authored May 14, 2019
2 parents ca9347f + 43c8eb6 commit 5f72845
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions hack/.shellcheck_failures
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
./hack/pin-dependency.sh
./hack/test-integration.sh
./hack/update-vendor.sh
./hack/verify-no-vendor-cycles.sh
./hack/verify-test-featuregates.sh
./test/cmd/batch.sh
./test/cmd/certificate.sh
Expand Down
14 changes: 5 additions & 9 deletions hack/verify-no-vendor-cycles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,16 @@ set -o errexit
set -o nounset
set -o pipefail

KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..

export GO111MODULE=auto

staging_repos=()
while IFS= read -r repo; do
staging_repos+=( "${repo}" )
done < <(ls "${KUBE_ROOT}/staging/src/k8s.io/")

staging_repos=($(ls "${KUBE_ROOT}/staging/src/k8s.io/"))
staging_repos_pattern=$(IFS="|"; echo "${staging_repos[*]}")

failed=false
while IFS= read -r -d '' i; do
deps=$(go list -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' ./"$i" 2> /dev/null || echo "")
for i in $(find vendor/ -type d); do
deps=$(go list -f '{{range .Deps}}{{.}}{{"\n"}}{{end}}' ./$i 2> /dev/null || echo "")
deps_on_main=$(echo "${deps}" | grep -v "k8s.io/kubernetes/vendor/" | grep "k8s.io/kubernetes" || echo "")
if [ -n "${deps_on_main}" ]; then
echo "Package ${i} has a cyclic dependency on the main repository."
Expand All @@ -42,7 +38,7 @@ while IFS= read -r -d '' i; do
echo "Package ${i} has a cyclic dependency on staging repository packages: ${deps_on_staging}"
failed=true
fi
done < <(find vendor/ -type d)
done

if [[ "${failed}" == "true" ]]; then
exit 1
Expand Down

0 comments on commit 5f72845

Please sign in to comment.