Sitelet https://github.com/kubernetes/kops/commit/d76881747380cbe973e039e35fb648932bddb490
Skip to content

Commit d768817

Browse files
authored
Merge pull request #18401 from hakman/gomod-tidy
gomod: tidy and verify all modules
2 parents c471afc + 692ef2d commit d768817

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎Makefile‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ ko-kops-utils-cp-push:
313313
gomod:
314314
go mod tidy
315315
go mod vendor
316-
cd hack; go mod tidy
317-
cd tests/e2e; go mod tidy
318-
cd tools/otel/traceserver; go mod tidy
316+
for dir in $$(find . -name go.mod -not -path './go.mod' -not -path './vendor/*' -not -path '*/.*' | xargs -n1 dirname | sort); do \
317+
echo "go mod tidy: $$dir"; \
318+
( cd "$$dir" && go mod tidy ); \
319+
done
319320

320321
.PHONY: gofmt
321322
gofmt:

‎hack/verify-gomod.sh‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ cd "${KOPS_ROOT}"
2424

2525
make gomod
2626

27-
changes=$(git status --porcelain go.mod go.sum vendor/ tests/e2e/go.mod tests/e2e/go.sum || true)
27+
# Check every module's go.mod/go.sum plus the vendored tree, excluding hidden directories
28+
# that aren't part of the source (e.g. .claude worktrees, .idea).
29+
changes=$(git status --porcelain -- '*go.mod' '*go.sum' vendor/ ':(exclude,glob)**/.*/**' || true)
2830
if [ -n "${changes}" ]; then
2931
echo "ERROR: go modules are not up to date; please run: make gomod"
3032
echo "changed files:"

0 commit comments

Comments
 (0)