Skip to content

Commit

Permalink
Makefile: Reduce the amount of vendoring calls
Browse files Browse the repository at this point in the history
When generating Go code for proto API or k8s CRDs, we don't need to run
vendoring for all modules before and after. It should be enough if we run
vendoring only for the relevant module (api or pkg/k8s) before, and only for
the main module after.

Signed-off-by: Anna Kapuscinska <anna@isovalent.com>
  • Loading branch information
lambdanis committed Jul 12, 2024
1 parent b83e10c commit c4f32bd
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,11 @@ codegen: | protogen
protogen: protoc-gen-go-tetragon ## Generate code based on .proto files.
# Need to call vendor twice here, once before and once after codegen the reason
# being we need to grab changes first plus pull in whatever gets generated here.
$(MAKE) vendor
$(MAKE) -C api vendor
$(MAKE) -C api
$(MAKE) vendor
$(GO) mod tidy
$(GO) mod vendor
$(GO) mod verify

.PHONY: protoc-gen-go-tetragon
protoc-gen-go-tetragon:
Expand All @@ -368,15 +370,17 @@ generate: | crds
crds: ## Generate kubebuilder files.
# Need to call vendor twice here, once before and once after generate, the reason
# being we need to grab changes first plus pull in whatever gets generated here.
$(MAKE) vendor
$(MAKE) -C pkg/k8s/
$(MAKE) vendor
$(MAKE) -C pkg/k8s vendor
$(MAKE) -C pkg/k8s
$(GO) mod tidy
$(GO) mod vendor
$(GO) mod verify

.PHONY: vendor
vendor: ## Tidy and vendor Go modules.
$(MAKE) -C ./api vendor
$(MAKE) -C ./pkg/k8s vendor
$(MAKE) -C ./contrib/tetragon-rthooks vendor
$(MAKE) -C api vendor
$(MAKE) -C pkg/k8s vendor
$(MAKE) -C contrib/tetragon-rthooks vendor
$(GO) mod tidy
$(GO) mod vendor
$(GO) mod verify
Expand Down

0 comments on commit c4f32bd

Please sign in to comment.