-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert "fix shellcheck failures of hack/verify-no-vendor-cycles.sh" #77841
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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/") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. for the future: this should be using find instead of ls |
||
|
||
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 "") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be quoting the whole string |
||
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." | ||
|
@@ -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) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
done | ||
|
||
if [[ "${failed}" == "true" ]]; then | ||
exit 1 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change was right