@@ -101,8 +101,9 @@ help: ## Display this help.
101101# #@ Development
102102
103103.PHONY : manifests
104- manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
104+ manifests : controller-gen kubebuilder # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
105105 $(CONTROLLER_GEN ) rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
106+ $(KUBEBUILDER ) edit --plugins=helm/v1-alpha --force # # regenerate the helm charts
106107
107108.PHONY : generate
108109generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
@@ -121,7 +122,7 @@ mod.check:#check go module dependencies
121122 @echo ' running "go mod verify"'
122123 @go mod verify
123124 @echo ' checking for modified files.'
124- # fail in case there are uncommitted changes
125+ # fail in case there are uncommitted changes
125126 @ git diff --quiet || (echo " files were modified: " ; git status --porcelain ; false)
126127
127128.PHONY : test
@@ -255,12 +256,20 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize-$(KUSTOMIZE_VERSION)
255256CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen-$(CONTROLLER_TOOLS_VERSION )
256257ENVTEST ?= $(LOCALBIN ) /setup-envtest-$(ENVTEST_VERSION )
257258GOLANGCI_LINT = $(LOCALBIN ) /golangci-lint-$(GOLANGCI_LINT_VERSION )
259+ KUBEBUILDER ?= $(LOCALBIN ) /kubebuilder-$(KUBEBUILDER_VERSION )
258260
259261# # Tool Versions
260262KUSTOMIZE_VERSION ?= v5.3.0
261263CONTROLLER_TOOLS_VERSION ?= v0.14.0
262264ENVTEST_VERSION ?= release-0.17
263265GOLANGCI_LINT_VERSION ?= v1.63.4
266+ KUBEBUILDER_VERSION ?= v4.5.0
267+
268+ .PHONY : kubebuilder
269+ kubebuilder : $(KUBEBUILDER ) # # Download kubebuilder locally if necessary.
270+ $(KUBEBUILDER ) : $(LOCALBIN )
271+ curl -L -o $(KUBEBUILDER ) https://github.com/kubernetes-sigs/kubebuilder/releases/download/$(KUBEBUILDER_VERSION ) /kubebuilder_$(shell go env GOOS) _$(shell go env GOARCH)
272+ chmod +x $(KUBEBUILDER )
264273
265274.PHONY : kustomize
266275kustomize : $(KUSTOMIZE ) # # Download kustomize locally if necessary.
0 commit comments