Skip to content

Commit 9342f69

Browse files
committed
use ifeq to conditional statements
1 parent 3e0137a commit 9342f69

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ SHELL = /usr/bin/env bash -o pipefail
2727

2828
ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
2929
KIND_CLUSTER_CONFIG_DIR=$(shell pwd)/config/kind
30-
KUBECTL_CONFIG_BACKUP_DIR=$(shell pwd)/.kube
30+
KUBECONFIG_BACKUP_DIR=$(shell pwd)/.kube
3131

3232
all: build
3333

@@ -53,7 +53,10 @@ ifeq (1, $(shell kind get clusters | grep ${KIND_CLUSTER_NAME} | wc -l | tr -d '
5353
else
5454
@echo "Creating Cluster"
5555
kind create cluster --name ${KIND_CLUSTER_NAME} --image=kindest/node:${K8S_NODE_IMAGE} --config ${KIND_CLUSTER_CONFIG_DIR}/cluster.yaml
56-
if [ "${IN_DEV_CONTAINER}" = "true" ]; then mkdir -p ${KUBECTL_CONFIG_BACKUP_DIR} && kind get kubeconfig --name ${KIND_CLUSTER_NAME} > ${KUBECTL_CONFIG_BACKUP_DIR}/kind-conifg.yaml; fi
56+
ifeq ($(IN_DEV_CONTAINER), true)
57+
@echo "kubeconfig backup =>"
58+
mkdir -p ${KUBECONFIG_BACKUP_DIR} && kind get kubeconfig --name ${KIND_CLUSTER_NAME} > ${KUBECONFIG_BACKUP_DIR}/kind-conifg.yaml
59+
endif
5760
endif
5861

5962
##@ Development

0 commit comments

Comments
 (0)