From d0486815e9aa5a06f03f4dc7553089eadd294d8f Mon Sep 17 00:00:00 2001 From: Francesco Torta <62566275+fra98@users.noreply.github.com> Date: Tue, 22 Oct 2024 19:57:40 +0200 Subject: [PATCH] fix: avoid creation of VirtualNode if ResourceSlice deleting --- .../virtualnodecreator_controller.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/liqo-controller-manager/virtualnodecreator-controller/virtualnodecreator_controller.go b/pkg/liqo-controller-manager/virtualnodecreator-controller/virtualnodecreator_controller.go index 52e25a3402..3e34e3c3a2 100644 --- a/pkg/liqo-controller-manager/virtualnodecreator-controller/virtualnodecreator_controller.go +++ b/pkg/liqo-controller-manager/virtualnodecreator-controller/virtualnodecreator_controller.go @@ -75,6 +75,11 @@ func (r *VirtualNodeCreatorReconciler) Reconcile(ctx context.Context, req ctrl.R return ctrl.Result{}, err } + if resourceSlice.DeletionTimestamp != nil { + klog.V(6).Infof("ResourceSlice %q is being deleted", req.NamespacedName) + return ctrl.Result{}, nil + } + if resourceSlice.Annotations == nil || resourceSlice.Annotations[consts.CreateVirtualNodeAnnotation] == "" || strings.EqualFold(resourceSlice.Annotations[consts.CreateVirtualNodeAnnotation], "false") {