diff --git a/pkg/operator/controllers/gameserver_controller.go b/pkg/operator/controllers/gameserver_controller.go index 6722f8c5..98595c93 100644 --- a/pkg/operator/controllers/gameserver_controller.go +++ b/pkg/operator/controllers/gameserver_controller.go @@ -155,7 +155,11 @@ func (r *GameServerReconciler) Reconcile(ctx context.Context, req ctrl.Request) } // updating GameServer with the new state if err := r.Status().Patch(ctx, &gs, patch); err != nil { - return ctrl.Result{}, err + // there is a chance that we have arrived here while the GameServer has been deleted + // in this case, .Patch will fail with NotFound error and we can safely ignore it + if !apierrors.IsNotFound(err) { + return ctrl.Result{}, err + } } return ctrl.Result{}, nil }