@@ -229,15 +229,23 @@ docker-push: .dockerflag.mk ## Push docker image with the manager.
229
229
# # --------------------------------------
230
230
231
231
.PHONY : tilt-up
232
- tilt-up : cluster-api kind-cluster cluster-api/tilt-settings.json generate-manifests # # Setup and run tilt for development.
232
+ tilt-up : cluster-api create- kind-cluster cluster-api/tilt-settings.json generate-manifests # # Setup and run tilt for development.
233
233
cd cluster-api && tilt up
234
234
235
- .PHONY : kind-cluster
236
- kind-cluster : cluster-api # # Create a kind cluster with a local Docker repository.
237
- ./cluster-api/hack/kind-install-for-capd.sh
235
+ KIND_CLUSTER_NAME := $(shell cat ./hack/tilt-settings.json | grep kind_cluster_name | cut -d: -f2 | xargs)
236
+
237
+ .PHONY : create-kind-cluster
238
+ create-kind-cluster : cluster-api cluster-api/tilt-settings.json # # Create a kind cluster with a local Docker repository.
239
+ @if [ -z " $$ (kind get clusters | grep $( KIND_CLUSTER_NAME) )" ]; then \
240
+ CAPI_KIND_CLUSTER_NAME=$(KIND_CLUSTER_NAME ) ./cluster-api/hack/kind-install-for-capd.sh; \
241
+ fi ;
242
+
243
+ .PHONY : delete-kind-cluster
244
+ delete-kind-cluster :
245
+ kind delete cluster --name $(KIND_CLUSTER_NAME )
238
246
239
247
cluster-api : # # Clone cluster-api repository for tilt use.
240
- git clone --branch v1.2.12 --depth 1 https://github.com/kubernetes-sigs/cluster-api.git
248
+ git clone --branch v1.3.9 --depth 1 https://github.com/kubernetes-sigs/cluster-api.git
241
249
242
250
cluster-api/tilt-settings.json : hack/tilt-settings.json cluster-api
243
251
cp ./hack/tilt-settings.json cluster-api
@@ -277,7 +285,7 @@ e2e-cluster-templates: $(CLUSTER_TEMPLATES_OUTPUT_FILES) ## Generate cluster tem
277
285
cluster-template% yaml : $(KUSTOMIZE ) $(CLUSTER_TEMPLATES_INPUT_FILES )
278
286
$(KUSTOMIZE ) build --load-restrictor LoadRestrictionsNone $(basename $@ ) > $@
279
287
280
- e2e-essentials : $(GINKGO_V1 ) $(KUBECTL ) e2e-cluster-templates kind-cluster # # Fulfill essential tasks for e2e testing.
288
+ e2e-essentials : $(GINKGO_V1 ) $(KUBECTL ) e2e-cluster-templates create- kind-cluster # # Fulfill essential tasks for e2e testing.
281
289
IMG=$(IMG_LOCAL ) make generate-manifests docker-build docker-push
282
290
283
291
JOB ?= .*
0 commit comments