Skip to content

Commit 3ea84e6

Browse files
authored
Merge pull request #2213 from evanfreed/fix_skip_existing_identity
Skip Existing Secret During Identity Creation
2 parents 82f169f + 9292eb1 commit 3ea84e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

hack/create-identity-secret.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,8 @@ cd "${REPO_ROOT}" && make "${KUBECTL##*/}"
2626
# shellcheck source=hack/parse-prow-creds.sh
2727
source "${REPO_ROOT}/hack/parse-prow-creds.sh"
2828

29-
"${KUBECTL}" create secret generic "${AZURE_CLUSTER_IDENTITY_SECRET_NAME}" --from-literal=clientSecret="${AZURE_CLIENT_SECRET}"
29+
if ! "${KUBECTL}" get secret "${AZURE_CLUSTER_IDENTITY_SECRET_NAME}" > /dev/null; then
30+
"${KUBECTL}" create secret generic "${AZURE_CLUSTER_IDENTITY_SECRET_NAME}" --from-literal=clientSecret="${AZURE_CLIENT_SECRET}"
31+
fi
32+
3033
"${KUBECTL}" label secret "${AZURE_CLUSTER_IDENTITY_SECRET_NAME}" "clusterctl.cluster.x-k8s.io/move-hierarchy=true" --overwrite=true

0 commit comments

Comments
 (0)