Commit 43ff2edc authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #31913 from dims/fix-go-lint-on-mac

Automatic merge from submit-queue fix hack/verify-golint.sh on a Mac Relax the location of the files a bit (Don't assume the k8s.io/kubernetes always!) Fixes #31905
parents 6946cce0 773e1c7f
...@@ -51,8 +51,11 @@ if ! diff -u "${linted_file}" <(LANG=C sort "${linted_file}"); then ...@@ -51,8 +51,11 @@ if ! diff -u "${linted_file}" <(LANG=C sort "${linted_file}"); then
fi fi
export IFS=$'\n' export IFS=$'\n'
# NOTE: when "go list -e ./..." is run within GOPATH, it turns the k8s.io/kubernetes
# as the prefix, however if we run it outside it returns the full path of the file
# with a leading underscore. We'll need to support both scenarios for all_packages.
all_packages=( all_packages=(
$(go list -e ./... | egrep -v "/(third_party|vendor|staging|generated|clientset_generated)" | sed 's/k8s.io\/kubernetes\///g') $(go list -e ./... | egrep -v "/(third_party|vendor|staging|generated|clientset_generated)" | sed -e 's|^k8s.io/kubernetes/||' -e "s|^_${KUBE_ROOT}/\?||")
) )
linted_packages=( linted_packages=(
$(cat $linted_file) $(cat $linted_file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment