curl -s https://gist.githubusercontent.com/fl64/a72b15b5e8ff169f34162d58794bfdd9/raw/dvp-migrate-cloudinit-secret.sh | bash -s -- env-1b4119-testcases env-1b4119-cloud-init-with-mounted-vi-pvc
Last active
October 15, 2024 09:51
-
-
Save fl64/a72b15b5e8ff169f34162d58794bfdd9 to your computer and use it in GitHub Desktop.
migrate-cloud-init-secret
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
NAMESPACE=${1} | |
SECRET_NAME=${2} | |
# TMP_NAME="${NAMESPACE}-${SECRET_NAME}-$(date +%s).tmp" | |
TMP_NAME="${NAMESPACE}-${SECRET_NAME}.tmp" | |
kubectl get secret ${SECRET_NAME} -o json | jq 'del(.metadata.resourceVersion) | .type = "provisioning.virtualization.deckhouse.io/cloud-init"' > "${TMP_NAME}" | |
kubectl patch secret "${SECRET_NAME}" --type=merge -p '{"metadata":{"finalizers":[]}}' | |
kubectl delete secret "${SECRET_NAME}" | |
kubectl apply -f "${TMP_NAME}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment