Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.

Commit 9b50108

Browse files
committed
Makefile: Add support for overriding the kubectl executable
Signed-off-by: timflannagan <[email protected]>
1 parent 3b5e67a commit 9b50108

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Makefile

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ REGISTRY_NAMESPACE=rukpak-e2e
2020
DNS_NAME=$(REGISTRY_NAME).$(REGISTRY_NAMESPACE).svc.cluster.local
2121

2222
CONTAINER_RUNTIME ?= docker
23+
KUBECTL ?= kubectl
2324

2425
# kernel-style V=1 build verbosity
2526
ifeq ("$(origin V)", "command line")
@@ -106,7 +107,7 @@ kind-cluster: kind kind-cluster-cleanup ## Standup a kind cluster
106107
kind-cluster-cleanup: kind ## Delete the kind cluster
107108
$(KIND) delete cluster --name ${KIND_CLUSTER_NAME}
108109

109-
image-registry: ## Setup in-cluster image registry
110+
image-registry: ## Setup in-cluster image registry
110111
./tools/imageregistry/setup_imageregistry.sh ${KIND_CLUSTER_NAME}
111112

112113
###################
@@ -119,22 +120,22 @@ image-registry: ## Setup in-cluster image registry
119120
install: generate cert-mgr install-manifests wait ## Install rukpak
120121

121122
install-manifests:
122-
kubectl apply -k manifests
123+
$(KUBECTL) apply -k manifests
123124

124125
wait:
125-
kubectl wait --for=condition=Available --namespace=$(RUKPAK_NAMESPACE) deployment/core --timeout=60s
126-
kubectl wait --for=condition=Available --namespace=$(RUKPAK_NAMESPACE) deployment/rukpak-webhooks --timeout=60s
127-
kubectl wait --for=condition=Available --namespace=$(RUKPAK_NAMESPACE) deployment/helm-provisioner --timeout=60s
128-
kubectl wait --for=condition=Available --namespace=crdvalidator-system deployment/crd-validation-webhook --timeout=60s
126+
$(KUBECTL) wait --for=condition=Available --namespace=$(RUKPAK_NAMESPACE) deployment/core --timeout=60s
127+
$(KUBECTL) wait --for=condition=Available --namespace=$(RUKPAK_NAMESPACE) deployment/rukpak-webhooks --timeout=60s
128+
$(KUBECTL) wait --for=condition=Available --namespace=$(RUKPAK_NAMESPACE) deployment/helm-provisioner --timeout=60s
129+
$(KUBECTL) wait --for=condition=Available --namespace=crdvalidator-system deployment/crd-validation-webhook --timeout=60s
129130

130131
run: build-container kind-cluster kind-load install ## Build image, stop/start a local kind cluster, and run operator in that cluster
131132

132133
cert-mgr: ## Install the certification manager
133-
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MGR_VERSION)/cert-manager.yaml
134-
kubectl wait --for=condition=Available --namespace=cert-manager deployment/cert-manager-webhook --timeout=60s
134+
$(KUBECTL) apply -f https://github.com/cert-manager/cert-manager/releases/download/$(CERT_MGR_VERSION)/cert-manager.yaml
135+
$(KUBECTL) wait --for=condition=Available --namespace=cert-manager deployment/cert-manager-webhook --timeout=60s
135136

136137
uninstall: ## Remove all rukpak resources from the cluster
137-
kubectl delete -k manifests
138+
$(KUBECTL) delete -k manifests
138139

139140
##################
140141
# Build and Load #
@@ -204,7 +205,7 @@ release: goreleaser substitute ## Run goreleaser
204205

205206
quickstart: VERSION ?= $(shell git describe --abbrev=0 --tags)
206207
quickstart: generate ## Generate the installation release manifests
207-
kubectl kustomize manifests | sed "s/:latest/:$(VERSION)/g" > rukpak.yaml
208+
$(KUBECTL) kustomize manifests | sed "s/:latest/:$(VERSION)/g" > rukpak.yaml
208209

209210
################
210211
# Hack / Tools #
@@ -242,4 +243,3 @@ $(GORELEASER): $(TOOLS_DIR)/go.mod # Build goreleaser from tools folder.
242243
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/goreleaser github.com/goreleaser/goreleaser
243244
$(KIND): $(TOOLS_DIR)/go.mod
244245
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/kind sigs.k8s.io/kind
245-

0 commit comments

Comments
 (0)