Skip to content

Commit

Permalink
Merge pull request kubernetes#123648 from thockin/use_go.work_to_find…
Browse files Browse the repository at this point in the history
…_internal_modules

Use go.work to auto-find internal modules
  • Loading branch information
k8s-ci-robot committed Mar 2, 2024
2 parents 1fceb81 + 90e6546 commit 38e5a29
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions hack/update-internal-modules.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ source "${KUBE_ROOT}/hack/lib/init.sh"

# These are "internal" modules. For various reasons, we want them to be
# decoupled from their parent modules.
MODULES=(
hack/tools
staging/src/k8s.io/code-generator/examples
staging/src/k8s.io/kms/internal/plugins/_mock
)
MODULES=()
kube::util::read-array MODULES < <(
git ls-files -cmo --exclude-standard -- ':!:vendor/*' ':(glob)*/**/go.work' \
| while read -r F; do \
dirname "${F}"; \
done
)

# Detect problematic GOPROXY settings that prevent lookup of dependencies
if [[ "${GOPROXY:-}" == "off" ]]; then
Expand All @@ -38,9 +40,7 @@ fi
kube::golang::setup_env

for mod in "${MODULES[@]}"; do
pushd "${KUBE_ROOT}/${mod}" >/dev/null
echo "=== tidying go.mod/go.sum in ${mod}"
go mod edit -fmt
go mod tidy
popd >/dev/null
echo "=== tidying go.mod/go.sum in ${mod}"
go -C "${KUBE_ROOT}/${mod}" mod edit -fmt
go -C "${KUBE_ROOT}/${mod}" mod tidy
done

0 comments on commit 38e5a29

Please sign in to comment.