From c972164fc4b5a1590898ec7731f26043a905dfe9 Mon Sep 17 00:00:00 2001 From: Tomer Liberman Date: Sun, 17 Aug 2025 19:13:04 +0300 Subject: [PATCH] Update pv-updater.sh Fix pv-updater.sh for changes in yq, and restore needed escaping for patching previous reclaim policy --- contrib/pv-updater.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/pv-updater.sh b/contrib/pv-updater.sh index 5b8a04a..92ca207 100755 --- a/contrib/pv-updater.sh +++ b/contrib/pv-updater.sh @@ -49,7 +49,7 @@ reclaimPolicy=$(yq '.spec.persistentVolumeReclaimPolicy' "${PV_ORIG_FILE}") cp "${PV_ORIG_FILE}" "${PV_TMP_FILE}" # pre-process before edit -yq -i -y 'del(.metadata.resourceVersion)' "${PV_TMP_FILE}" +yq -i 'del(.metadata.resourceVersion)' "${PV_TMP_FILE}" # manually edit ${EDITOR} "${PV_TMP_FILE}" @@ -69,7 +69,7 @@ kubectl patch pv "${PV}" -p '{"metadata":{"finalizers": null }}' &>/dev/null || kubectl apply -f "${PV_TMP_FILE}" # restore original reclaim value -kubectl patch pv "${PV}" -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":${reclaimPolicy}}}" +kubectl patch pv "${PV}" -p "{\"spec\":{\"persistentVolumeReclaimPolicy\":\"${reclaimPolicy}\"}}" # spit out any zfs properties updates yes_or_no "Would you like to delete the PV backup file?" && {