mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
Merge pull request #121836 from skitt/verify-no-vendor-cycles-go
verify-no-vendor-cycles: set up Go environment
This commit is contained in:
commit
9680c84b9c
@ -27,6 +27,9 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
|||||||
|
|
||||||
export GO111MODULE=on
|
export GO111MODULE=on
|
||||||
|
|
||||||
|
kube::golang::verify_go_version
|
||||||
|
kube::golang::setup_env
|
||||||
|
|
||||||
staging_repos=()
|
staging_repos=()
|
||||||
kube::util::read-array staging_repos < <(kube::util::list_staging_repos)
|
kube::util::read-array staging_repos < <(kube::util::list_staging_repos)
|
||||||
staging_repos_pattern=$(IFS="|"; echo "${staging_repos[*]}")
|
staging_repos_pattern=$(IFS="|"; echo "${staging_repos[*]}")
|
||||||
@ -34,7 +37,7 @@ staging_repos_pattern=$(IFS="|"; echo "${staging_repos[*]}")
|
|||||||
cd "${KUBE_ROOT}"
|
cd "${KUBE_ROOT}"
|
||||||
|
|
||||||
# Check for any module that is not main or staging and depends on main or staging
|
# Check for any module that is not main or staging and depends on main or staging
|
||||||
bad_deps=$(go mod graph | grep -vE "^k8s.io\/(kubernetes|${staging_repos_pattern})" | grep -E "\sk8s.io\/(kubernetes|${staging_repos_pattern})" || true)
|
bad_deps=$(go mod graph | grep -vE "^k8s.io/(kubernetes|${staging_repos_pattern})" | grep -E "\sk8s.io/(kubernetes|${staging_repos_pattern})" || true)
|
||||||
if [[ -n "${bad_deps}" ]]; then
|
if [[ -n "${bad_deps}" ]]; then
|
||||||
echo "Found disallowed dependencies that transitively depend on k8s.io/kubernetes or staging modules:"
|
echo "Found disallowed dependencies that transitively depend on k8s.io/kubernetes or staging modules:"
|
||||||
echo "${bad_deps}"
|
echo "${bad_deps}"
|
||||||
|
Loading…
Reference in New Issue
Block a user