@@ -60,28 +60,8 @@ help: ## Display this help.
6060
6161# #@ Development
6262
63- .PHONY : manifests
64- manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
65- $(CONTROLLER_GEN ) rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
66- cp config/crd/bases/* helm/crds
67-
68- .PHONY : generate
69- generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
70- $(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
71-
72- tt :
73- $(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./pkg/controller/resourcegraphdefinition"
74-
75- .PHONY : fmt
76- fmt : # # Run go fmt against code.
77- go fmt ./...
78-
79- .PHONY : vet
80- vet : # # Run go vet against code.
81- go vet ./...
82-
8363.PHONY : test
84- test : manifests generate fmt vet # # Run tests. Use WHAT=unit or WHAT=integration
64+ test : generate fmt vet # # Run tests. Use WHAT=unit or WHAT=integration
8565ifeq ($(WHAT ) ,integration)
8666 go test -v ./test/integration/suites/... -coverprofile integration-cover.out
8767else ifeq ($(WHAT),unit)
@@ -110,12 +90,24 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
11090
11191# #@ Build
11292
93+ .PHONY : generate
94+ generate : # # Run go generate
95+ go generate ./...
96+
97+ .PHONY : fmt
98+ fmt : # # Run go fmt
99+ go fmt ./...
100+
101+ .PHONY : vet
102+ vet : # # Run go vet
103+ go vet ./...
104+
113105.PHONY : build
114- build : manifests generate fmt vet # # Build controller binary.
106+ build : generate fmt vet # # Build controller binary.
115107 go build -ldflags=${LDFLAGS} -o bin/controller ./cmd/controller/main.go
116108
117109.PHONY : run
118- run : manifests generate fmt vet # # Run a controller from your host.
110+ run : generate fmt vet # # Run a controller from your host.
119111 go run ./cmd/controller/main.go
120112
121113# If you wish to build the manager image targeting other platforms you can use the --platform flag.
@@ -158,13 +150,11 @@ KUBECTL ?= kubectl
158150KIND ?= kind
159151KUSTOMIZE ?= $(LOCALBIN ) /kustomize
160152KO ?= $(LOCALBIN ) /ko
161- CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
162153ENVTEST ?= $(LOCALBIN ) /setup-envtest
163154
164155# # Tool Versions
165156KO_VERSION ?= v0.17.1
166157KUSTOMIZE_VERSION ?= v5.2.1
167- CONTROLLER_TOOLS_VERSION ?= v0.16.2
168158
169159.PHONY : ko
170160ko : $(KO ) # # Download ko locally if necessary. If wrong version is installed, it will be removed before downloading.
@@ -184,12 +174,6 @@ $(KUSTOMIZE): $(LOCALBIN)
184174 fi
185175 test -s $(LOCALBIN ) /kustomize || GOBIN=$(LOCALBIN ) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION )
186176
187- .PHONY : controller-gen
188- controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
189- $(CONTROLLER_GEN ) : $(LOCALBIN )
190- test -s $(LOCALBIN ) /controller-gen && $(LOCALBIN ) /controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION ) || \
191- GOBIN=$(LOCALBIN ) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION )
192-
193177.PHONY : image
194178build-image : ko # # Build the kro controller images using ko build
195179 echo " Building kro image $( RELEASE_VERSION) .."
@@ -228,11 +212,11 @@ ifndef ignore-not-found
228212endif
229213
230214.PHONY : install
231- install : manifests # # Install CRDs into the K8s cluster specified in ~/.kube/config.
215+ install : generate # # Install CRDs into the K8s cluster specified in ~/.kube/config.
232216 $(KUBECTL ) apply -f ./helm/crds
233217
234218.PHONY : uninstall
235- uninstall : manifests kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config
219+ uninstall : kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config
236220 $(KUBECTL ) delete --ignore-not-found=$(ignore-not-found ) -f ./helm/crds
237221
238222.PHONY : deploy-kind
@@ -242,7 +226,7 @@ deploy-kind:
242226 $(KIND ) create cluster --name ${KIND_CLUSTER_NAME}
243227 $(KUBECTL ) --context kind-$(KIND_CLUSTER_NAME ) create namespace kro-system
244228 make install
245- # This generates deployment with ko://... used in image.
229+ # This generates deployment with ko://... used in image.
246230 # ko then intercepts it builds image, pushes to kind node, replaces the image in deployment and applies it
247231 helm template kro ./helm --namespace kro-system --set image.pullPolicy=Never --set image.ko=true | $(KO ) apply -f -
248232 kubectl wait --for=condition=ready --timeout=1m pod -n kro-system -l app.kubernetes.io/component=controller
0 commit comments