Skip to content

Commit 654f7e7

Browse files
authored
makefile: fix generated files target (#930)
1 parent 549621b commit 654f7e7

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

Makefile

+13-9
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,20 @@ help: ## Display this help.
5454

5555
##@ Development
5656

57-
.PHONY: manifests
58-
manifests: config/crd/bases/ingress.pomerium.io_pomerium.yaml
57+
.PHONY: generated
58+
generated: config/crd/bases/ingress.pomerium.io_pomerium.yaml apis/ingress/v1/zz_generated.deepcopy.go
5959
@echo "==> $@"
6060

61+
apis/ingress/v1/zz_generated.deepcopy.go: apis/ingress/v1/pomerium_types.go
62+
@echo "==> $@"
63+
@$(CONTROLLER_GEN) object:headerFile=./hack/boilerplate.go.txt paths=$(CRD_PACKAGE) output:dir=apis/ingress/v1
64+
6165
config/crd/bases/ingress.pomerium.io_pomerium.yaml: apis/ingress/v1/pomerium_types.go
6266
@echo "==> $@"
6367
@$(CONTROLLER_GEN) $(CRD_OPTIONS) rbac:roleName=manager-role crd paths=$(CRD_PACKAGE) output:crd:artifacts:config=config/crd/bases
6468

6569
.PHONY: test
66-
test: envoy manifests envtest pomerium-ui
70+
test: envoy generated envtest pomerium-ui
6771
@echo "==> $@"
6872
@KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path --arch=$(KUBEENV_GOARCH))" go test $(GOTAGS) ./...
6973

@@ -75,7 +79,7 @@ lint: envoy pomerium-ui
7579

7680
##@ Build
7781
.PHONY: build
78-
build: pomerium-ui build-go ## Build manager binary.
82+
build: generated pomerium-ui build-go ## Build manager binary.
7983
@echo "==> $@"
8084

8185

@@ -119,7 +123,7 @@ internal/ui/dist/index.js: internal/ui/node_modules
119123
@cd internal/ui && yarn build
120124

121125
.PHONY: run
122-
run: manifests
126+
run: generated
123127
@echo "==> $@"
124128
@go run $(GOTAGS) ./main.go
125129

@@ -141,17 +145,17 @@ snapshot:
141145
##@ Deployment
142146

143147
.PHONY: install
144-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
148+
install: generated kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
145149
@echo "==> $@"
146150
@$(KUSTOMIZE) build config/crd | kubectl apply -f -
147151

148152
.PHONY: uninstall
149-
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
153+
uninstall: generated kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config.
150154
@echo "==> $@"
151155
@$(KUSTOMIZE) build config/crd | kubectl delete -f -
152156

153157
.PHONY: deploy
154-
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
158+
deploy: generated kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
155159
@echo "==> $@"
156160
@cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
157161
@$(KUSTOMIZE) build config/default | kubectl apply -f -
@@ -203,7 +207,7 @@ deployment: kustomize
203207
@$(KUSTOMIZE) build config/default > deployment.yaml
204208

205209
.PHONY: docs
206-
docs: manifests
210+
docs: generated
207211
@echo "==> $@"
208212
@go run docs/cmd/main.go > reference.md
209213

0 commit comments

Comments
 (0)