mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
Merge pull request #123648 from thockin/use_go.work_to_find_internal_modules
Use go.work to auto-find internal modules
This commit is contained in:
commit
38e5a29df6
@ -23,11 +23,13 @@ source "${KUBE_ROOT}/hack/lib/init.sh"
|
|||||||
|
|
||||||
# These are "internal" modules. For various reasons, we want them to be
|
# These are "internal" modules. For various reasons, we want them to be
|
||||||
# decoupled from their parent modules.
|
# decoupled from their parent modules.
|
||||||
MODULES=(
|
MODULES=()
|
||||||
hack/tools
|
kube::util::read-array MODULES < <(
|
||||||
staging/src/k8s.io/code-generator/examples
|
git ls-files -cmo --exclude-standard -- ':!:vendor/*' ':(glob)*/**/go.work' \
|
||||||
staging/src/k8s.io/kms/internal/plugins/_mock
|
| while read -r F; do \
|
||||||
)
|
dirname "${F}"; \
|
||||||
|
done
|
||||||
|
)
|
||||||
|
|
||||||
# Detect problematic GOPROXY settings that prevent lookup of dependencies
|
# Detect problematic GOPROXY settings that prevent lookup of dependencies
|
||||||
if [[ "${GOPROXY:-}" == "off" ]]; then
|
if [[ "${GOPROXY:-}" == "off" ]]; then
|
||||||
@ -38,9 +40,7 @@ fi
|
|||||||
kube::golang::setup_env
|
kube::golang::setup_env
|
||||||
|
|
||||||
for mod in "${MODULES[@]}"; do
|
for mod in "${MODULES[@]}"; do
|
||||||
pushd "${KUBE_ROOT}/${mod}" >/dev/null
|
echo "=== tidying go.mod/go.sum in ${mod}"
|
||||||
echo "=== tidying go.mod/go.sum in ${mod}"
|
go -C "${KUBE_ROOT}/${mod}" mod edit -fmt
|
||||||
go mod edit -fmt
|
go -C "${KUBE_ROOT}/${mod}" mod tidy
|
||||||
go mod tidy
|
|
||||||
popd >/dev/null
|
|
||||||
done
|
done
|
||||||
|
Loading…
Reference in New Issue
Block a user