Skip to content

Commit

Permalink
Fix deletion routine bug when virtualnode is created with createNode=…
Browse files Browse the repository at this point in the history
…false
  • Loading branch information
fra98 authored and adamjensenbot committed Sep 6, 2024
1 parent d59fcc8 commit a9c47d0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,16 +176,16 @@ 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,
}})
}

klog.Infof("Deletion routine completed for virtual node %s", vn.Name)
return err
return nil
}

// deleteNode deletes the Node created by VirtualNode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a9c47d0

Please sign in to comment.