From aa11f9965face4a6b94de6df040e0ba93667eb76 Mon Sep 17 00:00:00 2001 From: Zhecheng Li Date: Wed, 23 Aug 2023 03:18:42 +0000 Subject: [PATCH] Remove control-plane-azure-json before creation If the secret exists, the script to create will fail. Signed-off-by: Zhecheng Li --- hack/create-custom-cloud-provider-config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/create-custom-cloud-provider-config.sh b/hack/create-custom-cloud-provider-config.sh index 7385b75574a..4da7c48ba71 100755 --- a/hack/create-custom-cloud-provider-config.sh +++ b/hack/create-custom-cloud-provider-config.sh @@ -28,7 +28,8 @@ make --directory="${REPO_ROOT}" "${KUBECTL##*/}" if [[ -n "${CUSTOM_CLOUD_PROVIDER_CONFIG:-}" ]]; then curl --retry 3 -sL -o tmp_azure_json "${CUSTOM_CLOUD_PROVIDER_CONFIG}" envsubst < tmp_azure_json > azure_json - kubectl create secret generic "${CLUSTER_NAME}-control-plane-azure-json" \ + "${KUBECTL}" delete secret "${CLUSTER_NAME}-control-plane-azure-json" || true + "${KUBECTL}" create secret generic "${CLUSTER_NAME}-control-plane-azure-json" \ --from-file=control-plane-azure.json=azure_json \ --from-file=worker-node-azure.json=azure_json rm tmp_azure_json azure_json