Fix wrong kubectl call
* Fix wrong kubectl call
Calling kubectl.sh worked by accident in the testenvironment.
Replacing that call with ${_kubectl}.
* Ensure that we exit the rotate script if getting namespaces fails
@@ -44,11 +44,13 @@ if ${_kubectl} get routes ;
then
${_kubectl} delete routes --ignore-not-found=true --namespace "${namespace}" cdi-uploadproxy
fi
-# finally restart again, so that all registrations get recreated
-for ns in $(kubectl.sh get namespaces --no-headers -o custom-columns=":metadata.name") ;
+
+namespaces=$(${_kubectl} get namespaces --no-headers -o custom-columns=":metadata.name")
+for ns in ${namespaces} ;
do
${_kubectl} delete pods --namespace "${ns}" -l cdi.kubevirt.io
done
+# finally restart again, so that all registrations get recreated
${_kubectl} scale --namespace "${namespace}" --replicas=1 deployment/cdi-operator
echo "# Rotating kubevirt certificates ..."
