Last active
September 7, 2018 08:00
-
-
Save onlymellb/f783bc2128faf7b4220622b39ca1af6d to your computer and use it in GitHub Desktop.
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
#!/bin/bash -xe | |
phase=${1:-Release} | |
patch='{"metadata":{"annotations":{"volume.pingcap.com/pvManualDeleted":"true","volume.pingcap.com/pvTombstoned":"true"}}}' | |
pvs=`kubectl get pv|grep ${phase}|cut -d' ' -f1` | |
for pv in ${pvs} | |
do | |
echo "start to patch release phase pv: ${pv}" | |
kubectl patch pv/${pv} --patch ${patch} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment