From a9c47d0781619fe6fae810f360bfde7725274c39 Mon Sep 17 00:00:00 2001 From: Francesco Torta <62566275+fra98@users.noreply.github.com> Date: Fri, 6 Sep 2024 11:17:11 +0200 Subject: [PATCH] Fix deletion routine bug when virtualnode is created with createNode=false --- .../offloading/virtualnode-controller/deletion-routine.go | 6 +++--- .../virtualnode-controller/virtualnode_controller.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/liqo-controller-manager/offloading/virtualnode-controller/deletion-routine.go b/pkg/liqo-controller-manager/offloading/virtualnode-controller/deletion-routine.go index 4c8709b825..68fe6ba2d0 100644 --- a/pkg/liqo-controller-manager/offloading/virtualnode-controller/deletion-routine.go +++ b/pkg/liqo-controller-manager/offloading/virtualnode-controller/deletion-routine.go @@ -176,8 +176,8 @@ func (dr *DeletionRoutine) handle(ctx context.Context, key string) (err error) { return err } } else { - // Node is being deleted, but the VirtualNode resource is not. - // The VirtualNode .Spec.CreateNode field is set to false. + // Node is deleting/deleted, but the VirtualNode resource is not + // (the virtualNode .Spec.CreateNode field is set to false). ForgeCondition(vn, VnConditionMap{ offloadingv1beta1.NodeConditionType: VnCondition{ Status: offloadingv1beta1.NoneConditionStatusType, @@ -185,7 +185,7 @@ func (dr *DeletionRoutine) handle(ctx context.Context, key string) (err error) { } klog.Infof("Deletion routine completed for virtual node %s", vn.Name) - return err + return nil } // deleteNode deletes the Node created by VirtualNode. diff --git a/pkg/liqo-controller-manager/offloading/virtualnode-controller/virtualnode_controller.go b/pkg/liqo-controller-manager/offloading/virtualnode-controller/virtualnode_controller.go index dbfa826312..ae29962798 100644 --- a/pkg/liqo-controller-manager/offloading/virtualnode-controller/virtualnode_controller.go +++ b/pkg/liqo-controller-manager/offloading/virtualnode-controller/virtualnode_controller.go @@ -98,7 +98,7 @@ func (r *VirtualNodeReconciler) Reconcile(ctx context.Context, req ctrl.Request) virtualNode := &offloadingv1beta1.VirtualNode{} if err := r.Get(ctx, req.NamespacedName, virtualNode); err != nil { if apierrors.IsNotFound(err) { - klog.Infof("There is no a virtual-node called '%s' in '%s'", req.Name, req.Namespace) + klog.Infof("There is no virtual-node called %q in %q", req.Name, req.Namespace) return ctrl.Result{}, nil } return ctrl.Result{}, fmt.Errorf("unable to get the virtual-node %q: %w", req.NamespacedName, err)