Skip to content

Commit

Permalink
use ifeq to conditional statements
Browse files Browse the repository at this point in the history
  • Loading branch information
R-HNF committed Aug 24, 2023
1 parent 3e0137a commit 9342f69
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SHELL = /usr/bin/env bash -o pipefail

ENVTEST_ASSETS_DIR=$(shell pwd)/testbin
KIND_CLUSTER_CONFIG_DIR=$(shell pwd)/config/kind
KUBECTL_CONFIG_BACKUP_DIR=$(shell pwd)/.kube
KUBECONFIG_BACKUP_DIR=$(shell pwd)/.kube

all: build

Expand All @@ -53,7 +53,10 @@ ifeq (1, $(shell kind get clusters | grep ${KIND_CLUSTER_NAME} | wc -l | tr -d '
else
@echo "Creating Cluster"
kind create cluster --name ${KIND_CLUSTER_NAME} --image=kindest/node:${K8S_NODE_IMAGE} --config ${KIND_CLUSTER_CONFIG_DIR}/cluster.yaml
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
ifeq ($(IN_DEV_CONTAINER), true)
@echo "kubeconfig backup =>"
mkdir -p ${KUBECONFIG_BACKUP_DIR} && kind get kubeconfig --name ${KIND_CLUSTER_NAME} > ${KUBECONFIG_BACKUP_DIR}/kind-conifg.yaml
endif
endif

##@ Development
Expand Down

0 comments on commit 9342f69

Please sign in to comment.