From 7204ec3f9d90955591e4a3e468cfe3c1e0691f2f Mon Sep 17 00:00:00 2001 From: Ori Shavit Date: Wed, 25 Sep 2024 17:51:09 +0200 Subject: [PATCH] ignore Invalid errors too --- src/operator/controllers/iam/pods/pods_controller.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operator/controllers/iam/pods/pods_controller.go b/src/operator/controllers/iam/pods/pods_controller.go index 96ccabb..3ad5bb2 100644 --- a/src/operator/controllers/iam/pods/pods_controller.go +++ b/src/operator/controllers/iam/pods/pods_controller.go @@ -127,7 +127,7 @@ func (r *PodReconciler) handlePodCleanup(ctx context.Context, pod corev1.Pod) (c if controllerutil.RemoveFinalizer(updatedPod, r.agent.FinalizerName()) || controllerutil.RemoveFinalizer(updatedPod, metadata.DeprecatedIAMRoleFinalizer) { err := r.Patch(ctx, updatedPod, client.StrategicMergeFrom(&pod)) if err != nil { - if apierrors.IsConflict(err) || apierrors.IsNotFound(err) || apierrors.IsForbidden(err) { + if apierrors.IsConflict(err) || apierrors.IsNotFound(err) || apierrors.IsForbidden(err) || apierrors.IsInvalid(err) { // These are all errors that can happen because the pod is already being deleted, requeuing // should solve them all in a classy way return ctrl.Result{Requeue: true}, nil