cluster-clean, Add main function
@@ -25,6 +25,7 @@ source hack/common.sh
source cluster-up/cluster/$KUBEVIRT_PROVIDER/provider.sh
source hack/config.sh
+function main() {
echo "Cleaning up ..."
# Delete KubeVirt CR, timeout after 10 seconds
@@ -75,7 +76,7 @@ done
managed_namespaces=(${namespace} ${cdi_namespace})
# Delete all traces of kubevirt
-namespaces=(default ${namespace} ${cdi_namespace})
+ namespaces=(default ${managed_namespaces[@]})
labels=("operator.kubevirt.io" "operator.cdi.kubevirt.io" "kubevirt.io" "cdi.kubevirt.io")
# Namespaced resources
@@ -136,3 +137,6 @@ done
sleep 2
echo "Done $0"
+}
+
+main "$@"
