Skip to content

Commit 74c9fca

Browse files
liyinancndoit18
authored andcommitted
add kind environment
Signed-off-by: liyinan <[email protected]>
1 parent 720d915 commit 74c9fca

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ KUBEBUILDER_VERSION ?= 2.3.1
1414
HELM_VERSION ?= 3.2.4
1515
GOLANGCI_LINTER_VERSION ?= 1.24.0
1616
YQ_VERSION ?= 3.3.2
17+
KIND_VERSION ?= 0.11.1
1718

1819
GOOS ?= $(shell uname -s | tr '[:upper:]' '[:lower:]')
1920
GOARCH ?= amd64
@@ -125,6 +126,8 @@ dependencies-local: dependencies
125126
curl -sL https://get.helm.sh/helm-v$(HELM_VERSION)-$(GOOS)-$(GOARCH).tar.gz | \
126127
tar -C $(BINDIR) -xz --strip-components 1 $(GOOS)-$(GOARCH)/helm
127128
chmod +x $(BINDIR)/helm
129+
curl -Lo $(BINDIR)/kind "https://kind.sigs.k8s.io/dl/v$(KIND_VERSION)/kind-$$(go env GOOS)-$$(go env GOARCH)"
130+
chmod u+x $(BINDIR)/kind
128131

129132
# Build the docker image
130133
.PHONY: images
@@ -153,6 +156,22 @@ publish: images
153156
docker push $(REGISTRY)/$(SIDECAR_MYSQL8_IMAGE_NAME):$${tag}; \
154157
done
155158

159+
# Debug in local
160+
CLUSTER_NAME := mysql-operator
161+
162+
delete-environment:
163+
-@kind delete cluster --name $(CLUSTER_NAME)
164+
165+
create-environment: delete-environment images chart
166+
@kind create cluster --name $(CLUSTER_NAME)
167+
set -e; \
168+
for tag in $(IMAGE_TAGS); do \
169+
kind load docker-image --name $(CLUSTER_NAME) $(REGISTRY)/$(IMAGE_NAME):$${tag}; \
170+
kind load docker-image --name $(CLUSTER_NAME) $(REGISTRY)/$(ORCHESTRATOR_IMAGE_NAME):$${tag}; \
171+
kind load docker-image --name $(CLUSTER_NAME) $(REGISTRY)/$(SIDECAR_MYSQL57_IMAGE_NAME):$${tag}; \
172+
kind load docker-image --name $(CLUSTER_NAME) $(REGISTRY)/$(SIDECAR_MYSQL8_IMAGE_NAME):$${tag}; \
173+
done
174+
156175
# E2E tests
157176
###########
158177

0 commit comments

Comments
 (0)