Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save j-griffith/d44b40fd170c4f689ac2eae67ff5549d to your computer and use it in GitHub Desktop.
Save j-griffith/d44b40fd170c4f689ac2eae67ff5549d to your computer and use it in GitHub Desktop.
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