Created
June 12, 2019 20:50
-
-
Save j-griffith/d44b40fd170c4f689ac2eae67ff5549d 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
diff --git a/cluster-sync/clean.sh b/cluster-sync/clean.sh | |
index bba797d7..9b33bf9b 100755 | |
--- a/cluster-sync/clean.sh | |
+++ b/cluster-sync/clean.sh | |
@@ -10,6 +10,7 @@ OPERATOR_CR_MANIFEST=./_out/manifests/release/cdi-cr.yaml | |
OPERATOR_MANIFEST=./_out/manifests/release/cdi-operator.yaml | |
LABELS=("operator.cdi.kubevirt.io" "cdi.kubevirt.io") | |
NAMESPACES=(default cdi) | |
+CDI_NAMESPACE="cdi" | |
set +e | |
_kubectl patch cdi cdi --type=json -p '[{ "op": "remove", "path": "/metadata/finalizers" }]' | |
@@ -57,15 +58,15 @@ for label in ${labels[@]}; do | |
done | |
-if [ -n "$(_kubectl get ns | grep "cdi ")" ]; then | |
+if [ -n "$(_kubectl get ns | grep "${CDI_NAMESPACE} ")" ]; then | |
echo "Clean cdi namespace" | |
- _kubectl delete ns ${i} | |
+ _kubectl delete ns ${CDI_NAMESPACE} | |
start_time=0 | |
sample=10 | |
timeout=120 | |
echo "Waiting for cdi namespace to disappear ..." | |
- while [ -n "$(_kubectl get ns | grep "cdi ")" ]; do | |
+ while [ -n "$(_kubectl get ns | grep "${CDI_NAMESPACE} ")" ]; do | |
sleep $sample | |
start_time=$((current_time + sample)) | |
if [[ $current_time -gt $timeout ]]; then | |
(END) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment