From 1c49ebc4183d93117891b091e0563948e57389ac Mon Sep 17 00:00:00 2001 From: yangcheng-icbc Date: Thu, 15 Apr 2021 10:03:13 +0800 Subject: [PATCH] Cleanup the old configuration file of the cluster (#256) Signed-off-by: icbc-yangcheng --- hack/create-cluster.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hack/create-cluster.sh b/hack/create-cluster.sh index 43f47baed..f09a75617 100755 --- a/hack/create-cluster.sh +++ b/hack/create-cluster.sh @@ -26,6 +26,11 @@ if [[ -z "${KUBECONFIG}" ]]; then exit 1 fi +if [ -f "${KUBECONFIG}" ];then + echo "Removing old kubeconfig file." + rm -f ${KUBECONFIG} +fi + kind create cluster --name "${CLUSTER_NAME}" --kubeconfig="${KUBECONFIG}" --wait=120s # Kind cluster's context name contains a "kind-" prefix by default.