Skip to content

Commit

Permalink
Handle RootShard objects already deleted
Browse files Browse the repository at this point in the history
On-behalf-of: SAP <[email protected]>
Signed-off-by: Marvin Beckers <[email protected]>
  • Loading branch information
embik committed Jan 13, 2025
1 parent 8857d1c commit fe65cc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion internal/controller/rootshard_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ func (r *RootShardReconciler) Reconcile(ctx context.Context, req ctrl.Request) (

var rootShard v1alpha1.RootShard
if err := r.Client.Get(ctx, req.NamespacedName, &rootShard); err != nil {
return ctrl.Result{}, fmt.Errorf("failed to find %s/%s: %w", req.Namespace, req.Name, err)
if client.IgnoreNotFound(err) != nil {
return ctrl.Result{}, fmt.Errorf("failed to find %s/%s: %w", req.Namespace, req.Name, err)
}

// Object has apparently been deleted already.
return ctrl.Result{}, nil
}

if rootShard.DeletionTimestamp != nil {
Expand Down

0 comments on commit fe65cc4

Please sign in to comment.