@@ -58,6 +58,7 @@ ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
5858BIN_DIR := bin
5959BUILD_DIR := .build
6060TEST_DIR := test
61+ PACKAGING_DIR := packaging
6162VCSIM_DIR := test/infrastructure/vcsim
6263NETOP_DIR := test/infrastructure/net-operator
6364TEST_EXTENSION_DIR := test/extension
@@ -359,6 +360,7 @@ generate-go-conversions: $(CONTROLLER_GEN) $(CONVERSION_GEN) ## Runs Go related
359360generate-modules : # # Run go mod tidy to ensure modules are up to date
360361 go mod tidy
361362 cd $(TEST_DIR ) ; go mod tidy
363+ cd $(PACKAGING_DIR ) ; go mod tidy
362364
363365.PHONY : generate-doctoc
364366generate-doctoc :
@@ -460,6 +462,7 @@ generate-test-infra-prowjobs: $(PROWJOB_GEN) ## Generates the prowjob configurat
460462lint : $(GOLANGCI_LINT ) # # Lint the codebase
461463 $(GOLANGCI_LINT ) run -v $(GOLANGCI_LINT_EXTRA_ARGS )
462464 cd $(TEST_DIR ) ; $(GOLANGCI_LINT ) run --path-prefix $(TEST_DIR ) --config $(ROOT_DIR ) /.golangci.yml -v $(GOLANGCI_LINT_EXTRA_ARGS )
465+ cd $(PACKAGING_DIR ) ; $(GOLANGCI_LINT ) run --path-prefix $(PACKAGING_DIR ) --config $(ROOT_DIR ) /.golangci.yml -v $(GOLANGCI_LINT_EXTRA_ARGS )
463466
464467.PHONY : lint-fix
465468lint-fix : $(GOLANGCI_LINT ) # # Lint the codebase and run auto-fixers if supported by the linter
@@ -486,6 +489,10 @@ verify-modules: generate-modules ## Verify go modules are up to date
486489 git diff; \
487490 echo " go module files are out of date" ; exit 1; \
488491 fi
492+ @if ! (git diff --quiet HEAD -- go.sum go.mod $( PACKAGING_DIR) /go.mod $( PACKAGING_DIR) /go.sum); then \
493+ git diff; \
494+ echo " go module files are out of date" ; exit 1; \
495+ fi
489496 @if (find . -name ' go.mod' | xargs -n1 grep -q -i ' k8s.io/client-go.*+incompatible' ); then \
490497 find . -name " go.mod" -exec grep -i ' k8s.io/client-go.*+incompatible' {} \; -print; \
491498 echo " go module contains an incompatible client-go version" ; exit 1; \
@@ -532,6 +539,10 @@ verify-govulncheck: $(GOVULNCHECK) ## Verify code for vulnerabilities
532539 if [ " $$ R1" -ne " 0" ] || [ " $$ R2" -ne " 0" ]; then \
533540 exit 1; \
534541 fi
542+ $(GOVULNCHECK ) -C " $( PACKAGING_DIR) " ./... && R2=$$? || R2=$$? ; \
543+ if [ " $$ R1" -ne " 0" ] || [ " $$ R2" -ne " 0" ]; then \
544+ exit 1; \
545+ fi
535546
536547.PHONY : verify-security
537548verify-security : # # Verify code and images for vulnerabilities
@@ -786,7 +797,9 @@ e2e-flavors-main: $(RELEASE_DIR)
786797
787798.PHONY : generate-flavors
788799generate-flavors : $(FLAVOR_DIR )
789- go run ./packaging/flavorgen --output-dir $(FLAVOR_DIR )
800+ cd $(PACKAGING_DIR ) /flavorgen; go build -o flavorgen ./
801+ $(PACKAGING_DIR ) /flavorgen/flavorgen --output-dir $(FLAVOR_DIR )
802+ rm $(PACKAGING_DIR ) /flavorgen/flavorgen
790803
791804.PHONY : release-staging
792805release-staging : # # Build and push container images to the staging registry
0 commit comments