@@ -59,28 +59,8 @@ help: ## Display this help.
59
59
60
60
# #@ Development
61
61
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
-
82
62
.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
84
64
ifeq ($(WHAT ) ,integration)
85
65
go test -v ./test/integration/suites/... -coverprofile integration-cover.out
86
66
else ifeq ($(WHAT),unit)
@@ -109,12 +89,24 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
109
89
110
90
# #@ Build
111
91
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
+
112
104
.PHONY : build
113
- build : manifests generate fmt vet # # Build controller binary.
105
+ build : generate fmt vet # # Build controller binary.
114
106
go build -ldflags=${LDFLAGS} -o bin/controller ./cmd/controller/main.go
115
107
116
108
.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.
118
110
go run ./cmd/controller/main.go
119
111
120
112
# If you wish to build the manager image targeting other platforms you can use the --platform flag.
@@ -157,13 +149,11 @@ KUBECTL ?= kubectl
157
149
KIND ?= kind
158
150
KUSTOMIZE ?= $(LOCALBIN ) /kustomize
159
151
KO ?= $(LOCALBIN ) /ko
160
- CONTROLLER_GEN ?= $(LOCALBIN ) /controller-gen
161
152
ENVTEST ?= $(LOCALBIN ) /setup-envtest
162
153
163
154
# # Tool Versions
164
155
KO_VERSION ?= v0.17.1
165
156
KUSTOMIZE_VERSION ?= v5.2.1
166
- CONTROLLER_TOOLS_VERSION ?= v0.16.2
167
157
168
158
.PHONY : ko
169
159
ko : $(KO ) # # Download ko locally if necessary. If wrong version is installed, it will be removed before downloading.
@@ -183,12 +173,6 @@ $(KUSTOMIZE): $(LOCALBIN)
183
173
fi
184
174
test -s $(LOCALBIN ) /kustomize || GOBIN=$(LOCALBIN ) GO111MODULE=on go install sigs.k8s.io/kustomize/kustomize/v5@$(KUSTOMIZE_VERSION )
185
175
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
-
192
176
.PHONY : image
193
177
build-image : ko # # Build the kro controller images using ko build
194
178
echo " Building kro image $( RELEASE_VERSION) .."
@@ -227,11 +211,11 @@ ifndef ignore-not-found
227
211
endif
228
212
229
213
.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.
231
215
$(KUBECTL ) apply -f ./helm/crds
232
216
233
217
.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
235
219
$(KUBECTL ) delete --ignore-not-found=$(ignore-not-found ) -f ./helm/crds
236
220
237
221
.PHONY : deploy-kind
@@ -241,7 +225,7 @@ deploy-kind: ko
241
225
$(KIND ) create cluster --name ${KIND_CLUSTER_NAME}
242
226
$(KUBECTL ) --context kind-$(KIND_CLUSTER_NAME ) create namespace kro-system
243
227
make install
244
- # This generates deployment with ko://... used in image.
228
+ # This generates deployment with ko://... used in image.
245
229
# ko then intercepts it builds image, pushes to kind node, replaces the image in deployment and applies it
246
230
helm template kro ./helm --namespace kro-system --set image.pullPolicy=Never --set image.ko=true | $(KO ) apply -f -
247
231
kubectl wait --for=condition=ready --timeout=1m pod -n kro-system -l app.kubernetes.io/component=controller
0 commit comments