Skip to content

Commit a09009c

Browse files
Add kind start command to makefile
1 parent 61c9068 commit a09009c

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,25 @@ lint: golangci-lint ## Run golangci-lint linter & yamllint
112112
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
113113
$(GOLANGCI_LINT) run --fix
114114

115+
.PHONY: kind-start
116+
kind-start: ## Start a kind cluster if it doesn't exist
117+
@echo "Ensuring kind cluster is running..."
118+
@# Check if Docker is running
119+
@if ! $(CONTAINER_TOOL) info > /dev/null 2>&1; then \
120+
echo "Error: Docker daemon is not running. Please start Docker first."; \
121+
exit 1; \
122+
fi
123+
@if ! command -v kind > /dev/null; then \
124+
echo "Error: kind is not installed. Install it from https://kind.sigs.k8s.io/docs/user/quick-start/"; \
125+
exit 1; \
126+
fi
127+
@if ! kind get clusters | grep -q gobackup-operator; then \
128+
echo "Creating gobackup-operator kind cluster..."; \
129+
kind create cluster --name gobackup-operator; \
130+
else \
131+
echo "Using existing gobackup-operator kind cluster"; \
132+
fi
133+
115134
.PHONY: kind-run
116135
kind-run: fmt vet kustomize ## Run the operator on a local kind cluster
117136
@echo "Setting up and running the operator on a kind cluster"

0 commit comments

Comments
 (0)