@@ -59,28 +59,8 @@ help: ## Display this help.
5959
6060# #@ Development
6161
62- .PHONY : manifests
63- manifests : controller-gen # # Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
64- $(CONTROLLER_GEN ) rbac:roleName=manager-role crd webhook paths=" ./..." output:crd:artifacts:config=config/crd/bases
65- cp config/crd/bases/* helm/crds
66-
67- .PHONY : generate
68- generate : controller-gen # # Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
69- $(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./..."
70-
71- tt :
72- $(CONTROLLER_GEN ) object:headerFile=" hack/boilerplate.go.txt" paths=" ./pkg/controller/resourcegraphdefinition"
73-
74- .PHONY : fmt
75- fmt : # # Run go fmt against code.
76- go fmt ./...
77-
78- .PHONY : vet
79- vet : # # Run go vet against code.
80- go vet ./...
81-
8262.PHONY : test
83- test : manifests generate fmt vet # # Run tests. Use WHAT=unit or WHAT=integration
63+ test : generate fmt vet # # Run tests. Use WHAT=unit or WHAT=integration
8464ifeq ($(WHAT ) ,integration)
8565 go test -v ./test/integration/suites/... -coverprofile integration-cover.out
8666else ifeq ($(WHAT),unit)
@@ -109,12 +89,24 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
10989
11090# #@ Build
11191
92+ .PHONY : generate
93+ generate : # # Run go generate
94+ go generate ./...
95+
96+ .PHONY : fmt
97+ fmt : # # Run go fmt
98+ go fmt ./...
99+
100+ .PHONY : vet
101+ vet : # # Run go vet
102+ go vet ./...
103+
112104.PHONY : build
113- build : manifests generate fmt vet # # Build controller binary.
105+ build : generate fmt vet # # Build controller binary.
114106 go build -ldflags=${LDFLAGS} -o bin/controller ./cmd/controller/main.go
115107
116108.PHONY : run
117- run : manifests generate fmt vet # # Run a controller from your host.
109+ run : generate fmt vet # # Run a controller from your host.
118110 go run ./cmd/controller/main.go
119111
120112# If you wish to build the manager image targeting other platforms you can use the --platform flag.
@@ -157,13 +149,11 @@ KUBECTL ?= kubectl
157149KIND ?= kind
158150KUSTOMIZE ?= $(LOCALBIN ) /kustomize
159151KO ?= $(LOCALBIN ) /ko
160- CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
161152ENVTEST ?= $(LOCALBIN ) /setup-envtest
162153
163154# # Tool Versions
164155KO_VERSION ?= v0.17.1
165156KUSTOMIZE_VERSION ?= v5.2.1
166- CONTROLLER_TOOLS_VERSION ?= v0.16.2
167157
168158.PHONY : ko
169159ko : $(KO ) # # Download ko locally if necessary. If wrong version is installed, it will be removed before downloading.
@@ -183,12 +173,6 @@ $(KUSTOMIZE): $(LOCALBIN)
183173 fi
184174 test -s $(LOCALBIN ) /kustomize || GOBIN=$(LOCALBIN ) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION )
185175
186- .PHONY : controller-gen
187- controller-gen : $(CONTROLLER_GEN ) # # Download controller-gen locally if necessary. If wrong version is installed, it will be overwritten.
188- $(CONTROLLER_GEN ) : $(LOCALBIN )
189- test -s $(LOCALBIN ) /controller-gen && $(LOCALBIN ) /controller-gen --version | grep -q $(CONTROLLER_TOOLS_VERSION ) || \
190- GOBIN=$(LOCALBIN ) go install sigs.k8s.io/controller-tools/cmd/controller-gen@$(CONTROLLER_TOOLS_VERSION )
191-
192176.PHONY : image
193177build-image : ko # # Build the kro controller images using ko build
194178 echo " Building kro image $( RELEASE_VERSION) .."
@@ -227,11 +211,11 @@ ifndef ignore-not-found
227211endif
228212
229213.PHONY : install
230- install : manifests # # Install CRDs into the K8s cluster specified in ~/.kube/config.
214+ install : generate # # Install CRDs into the K8s cluster specified in ~/.kube/config.
231215 $(KUBECTL ) apply -f ./helm/crds
232216
233217.PHONY : uninstall
234- uninstall : manifests kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config
218+ uninstall : kustomize # # Uninstall CRDs from the K8s cluster specified in ~/.kube/config
235219 $(KUBECTL ) delete --ignore-not-found=$(ignore-not-found ) -f ./helm/crds
236220
237221.PHONY : deploy-kind
@@ -241,7 +225,7 @@ deploy-kind: ko
241225 $(KIND ) create cluster --name ${KIND_CLUSTER_NAME}
242226 $(KUBECTL ) --context kind-$(KIND_CLUSTER_NAME ) create namespace kro-system
243227 make install
244- # This generates deployment with ko://... used in image.
228+ # This generates deployment with ko://... used in image.
245229 # ko then intercepts it builds image, pushes to kind node, replaces the image in deployment and applies it
246230 helm template kro ./helm --namespace kro-system --set image.pullPolicy=Never --set image.ko=true | $(KO ) apply -f -
247231 kubectl wait --for=condition=ready --timeout=1m pod -n kro-system -l app.kubernetes.io/component=controller
0 commit comments