Skip to content

Commit

Permalink
faster deepcopy object generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Rasheed Abdul-Aziz committed Sep 29, 2021
1 parent 39baeb0 commit 2550c83
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,14 @@ build: gen-objects gen-manifests
run: build
build/cartographer

.PHONY: gen-objects
gen-objects:
crd_non_sources := pkg/apis/v1alpha1/zz_generated.deepcopy.go $(wildcard pkg/apis/v1alpha1/*_test.go)
crd_sources := $(filter-out $(crd_non_sources),$(wildcard pkg/apis/v1alpha1/*.go))

pkg/apis/v1alpha1/zz_generated.deepcopy.go: $(crd_sources)
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
object \
paths=./pkg/apis/v1alpha1

crd_non_sources := pkg/apis/v1alpha1/zz_generated.deepcopy.go $(wildcard pkg/apis/v1alpha1/*_test.go)
crd_sources := $(filter-out $(crd_non_sources),$(wildcard pkg/apis/v1alpha1/*.go))

config/crd/bases/*.yaml &: $(crd_sources)
go run sigs.k8s.io/controller-tools/cmd/controller-gen \
crd \
Expand All @@ -24,6 +23,9 @@ config/crd/bases/*.yaml &: $(crd_sources)
-f ./hack/boilerplate.go.txt \
config/crd/bases

.PHONY: gen-objects
gen-objects: pkg/apis/v1alpha1/zz_generated.deepcopy.go

.PHONY: gen-manifests
gen-manifests: config/crd/bases/*.yaml

Expand Down

0 comments on commit 2550c83

Please sign in to comment.