diff --git a/Makefile b/Makefile index 66ed0a618..7d5bc994c 100644 --- a/Makefile +++ b/Makefile @@ -55,6 +55,9 @@ CEPH_VERSION ?= $(shell . $(CURDIR)/build.env ; echo $${CEPH_VERSION}) # TODO: ceph_preview tag required for FSQuiesce API GO_TAGS_LIST ?= $(CEPH_VERSION) ceph_preview +# CephCSI currently has 4 modules in these directories. +GO_MODULES_LIST = ./ e2e/ api/ actions/retest + # go build flags LDFLAGS ?= LDFLAGS += -X $(GO_PROJECT)/internal/util.GitCommit=$(GIT_COMMIT) @@ -108,8 +111,11 @@ go-test-api: check-env @pushd api && ../scripts/test-go.sh && popd mod-check: check-env - @echo 'running: go mod verify' - @go mod verify && [ "$(shell sha512sum go.mod)" = "`sha512sum go.mod`" ] || ( echo "ERROR: go.mod was modified by 'go mod verify'" && false ) + for module in $(GO_MODULES_LIST); do \ + echo "running: go mod checks in $$module"; \ + (cd "$$module" && go mod tidy && go mod vendor && go mod verify);\ + done + test -z "$(shell git status --short)" || (echo "files were modified during go mod checks: " ; git status --short ; false) scripts/golangci.yml: scripts/golangci.yml.in rm -f scripts/golangci.yml.buildtags.in diff --git a/go.sum b/go.sum index eaab2b840..9ce1cfac5 100644 --- a/go.sum +++ b/go.sum @@ -1406,4 +1406,4 @@ sigs.k8s.io/structured-merge-diff/v4 v4.5.0/go.mod h1:N8f93tFZh9U6vpxwRArLiikrE5 sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= +sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= \ No newline at end of file