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