On cluster cleanup, don't fail if we can't remove removed vms
@@ -645,9 +645,11 @@ func cleanNamespaces() {
for _, vm := range vms.Items {
if controller.HasFinalizer(&vm, v1.VirtualMachineFinalizer) {
_, err := virtCli.VM(vm.Namespace).Patch(vm.Name, types.JSONPatchType, []byte("[{ \"op\": \"remove\", \"path\": \"/metadata/finalizers\" }]"))
+ if !errors.IsNotFound(err) {
PanicOnError(err)
}
}
+ }
// Remove all Pods
PanicOnError(virtCli.CoreV1().RESTClient().Delete().Namespace(namespace).Resource("pods").Do().Error())
