@@ -32,7 +32,7 @@ include Makefile.local
3232# Image URL to use all building/pushing image targets
3333IMG ?= ghcr.io/tv2-oss/bifrost-gateway-controller:latest
3434# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
35- ENVTEST_K8S_VERSION = 1.30 .0
35+ ENVTEST_K8S_VERSION = 1.32 .0
3636
3737# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
3838ifeq (,$(shell go env GOBIN) )
@@ -69,12 +69,12 @@ help: ## Display this help.
6969# #@ Development
7070
7171.PHONY : manifests
72- manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
73- $( CONTROLLER_GEN ) rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
72+ manifests : # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
73+ controller-gen rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
7474
7575.PHONY : generate
76- generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
77- $( CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
76+ generate : # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
77+ controller-gen object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
7878
7979.PHONY : fmt
8080fmt : # # Run go fmt against code.
@@ -85,15 +85,15 @@ vet: ## Run go vet against code.
8585 go vet ./...
8686
8787.PHONY : test
88- test : manifests generate fmt vet envtest # # Run tests.
89- KUBEBUILDER_ASSETS=" $( shell $( ENVTEST ) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test ./... -coverprofile cover.out
88+ test : manifests generate fmt vet # # Run tests.
89+ KUBEBUILDER_ASSETS=" $( shell setup-envtest use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " go test ./... -coverprofile cover.out
9090
9191.PHONY : test-ginkgo
92- test-ginkgo : manifests generate fmt vet envtest # # Run tests using ginkgo.
93- KUBEBUILDER_ASSETS=" $( shell $( ENVTEST ) use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " ginkgo -vv ./... -coverprofile cover.out
92+ test-ginkgo : manifests generate fmt vet # # Run tests using ginkgo.
93+ KUBEBUILDER_ASSETS=" $( shell setup-envtest use $( ENVTEST_K8S_VERSION) --bin-dir $( LOCALBIN) -p path) " ginkgo -vv ./... -coverprofile cover.out
9494
9595.PHONY : e2e-test
96- e2e-test : envtest
96+ e2e-test :
9797 (cd test/e2e/ && USE_EXISTING_CLUSTER=true go test)
9898
9999.PHONY : unit-test
@@ -127,10 +127,10 @@ run: manifests generate fmt vet ## Run a controller from your host.
127127 go run ./main.go
128128
129129.PHONY : manifest-build
130- manifest-build : kustomize
130+ manifest-build :
131131 mkdir config/release
132- $( KUSTOMIZE ) build config/crd -o config/release/crds.yaml
133- $( KUSTOMIZE ) build config/default -o config/release/install.yaml
132+ kustomize build config/crd -o config/release/crds.yaml
133+ kustomize build config/default -o config/release/install.yaml
134134
135135# If you wish built the manager image targeting other platforms you can use the --platform flag.
136136# (i.e. docker build --platform linux/arm64 ). However, you must enable docker buildKit for it.
@@ -167,21 +167,21 @@ ifndef ignore-not-found
167167endif
168168
169169.PHONY : install
170- install : manifests kustomize # # Install CRDs into the K8s cluster specified in ~/.kube/config.
171- $( KUSTOMIZE ) build config/crd | kubectl apply -f -
170+ install : manifests # # Install CRDs into the K8s cluster specified in ~/.kube/config.
171+ kustomize build config/crd | kubectl apply -f -
172172
173173.PHONY : uninstall
174- uninstall : manifests kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
175- $( KUSTOMIZE ) build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
174+ uninstall : manifests # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
175+ kustomize build config/crd | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
176176
177177.PHONY : deploy
178- deploy : manifests kustomize # # Deploy controller to the K8s cluster specified in ~/.kube/config.
179- cd config/manager && $( KUSTOMIZE ) edit set image controller=${IMG}
180- $( KUSTOMIZE ) build config/kind | kubectl apply -f -
178+ deploy : manifests # # Deploy controller to the K8s cluster specified in ~/.kube/config.
179+ cd config/manager && kustomize edit set image controller=${IMG}
180+ kustomize build config/kind | kubectl apply -f -
181181
182182.PHONY : undeploy
183183undeploy : # # Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
184- $( KUSTOMIZE ) build config/kind | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
184+ kustomize build config/kind | kubectl delete --ignore-not-found=$(ignore-not-found ) -f -
185185
186186# #@ Build Dependencies
187187
@@ -190,32 +190,6 @@ LOCALBIN ?= $(shell pwd)/bin
190190$(LOCALBIN ) :
191191 mkdir -p $(LOCALBIN )
192192
193- # # Tool Binaries
194- KUSTOMIZE ?= $(LOCALBIN ) /kustomize
195- CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
196- ENVTEST ?= $(LOCALBIN ) /setup-envtest
197-
198- # # Tool Versions
199- KUSTOMIZE_VERSION ?= v4.5.5
200- CONTROLLER_TOOLS_VERSION ?= v0.16.5
201- ENVTEST_VERSION ?= release-0.19
202-
203- KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
204- .PHONY : kustomize
205- kustomize : $(KUSTOMIZE ) # # Download kustomize locally if necessary.
206- $(KUSTOMIZE ) : $(LOCALBIN )
207- test -s $(LOCALBIN ) /kustomize || { curl -Ss $( KUSTOMIZE_INSTALL_SCRIPT) | bash -s -- $( subst v,,$( KUSTOMIZE_VERSION) ) $( LOCALBIN) ; }
208-
209- .PHONY : controller-gen
210- controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary.
211- $(CONTROLLER_GEN ) : $(LOCALBIN )
212- test -s $(LOCALBIN ) /controller-gen || GOBIN=$(LOCALBIN ) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION )
213-
214- .PHONY : envtest
215- envtest : $(ENVTEST ) # # Download envtest-setup locally if necessary.
216- $(ENVTEST ) : $(LOCALBIN )
217- test -s $(LOCALBIN ) /setup-envtest || GOBIN=$(LOCALBIN ) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@$(ENVTEST_VERSION )
218-
219193.PHONY : lint
220194lint :
221195 golangci-lint run -v --timeout 10m
0 commit comments