Skip to content

Commit fe65cc4

Browse files
committed
Handle RootShard objects already deleted
On-behalf-of: SAP <[email protected]> Signed-off-by: Marvin Beckers <[email protected]>
1 parent 8857d1c commit fe65cc4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

internal/controller/rootshard_controller.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ func (r *RootShardReconciler) Reconcile(ctx context.Context, req ctrl.Request) (
6666

6767
var rootShard v1alpha1.RootShard
6868
if err := r.Client.Get(ctx, req.NamespacedName, &rootShard); err != nil {
69-
return ctrl.Result{}, fmt.Errorf("failed to find %s/%s: %w", req.Namespace, req.Name, err)
69+
if client.IgnoreNotFound(err) != nil {
70+
return ctrl.Result{}, fmt.Errorf("failed to find %s/%s: %w", req.Namespace, req.Name, err)
71+
}
72+
73+
// Object has apparently been deleted already.
74+
return ctrl.Result{}, nil
7075
}
7176

7277
if rootShard.DeletionTimestamp != nil {

0 commit comments

Comments
 (0)