Skip to content

Commit d048681

Browse files
fra98adamjensenbot
authored andcommitted
fix: avoid creation of VirtualNode if ResourceSlice deleting
1 parent e2d5938 commit d048681

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/liqo-controller-manager/virtualnodecreator-controller/virtualnodecreator_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ func (r *VirtualNodeCreatorReconciler) Reconcile(ctx context.Context, req ctrl.R
7575
return ctrl.Result{}, err
7676
}
7777

78+
if resourceSlice.DeletionTimestamp != nil {
79+
klog.V(6).Infof("ResourceSlice %q is being deleted", req.NamespacedName)
80+
return ctrl.Result{}, nil
81+
}
82+
7883
if resourceSlice.Annotations == nil ||
7984
resourceSlice.Annotations[consts.CreateVirtualNodeAnnotation] == "" ||
8085
strings.EqualFold(resourceSlice.Annotations[consts.CreateVirtualNodeAnnotation], "false") {

0 commit comments

Comments
 (0)