Skip to content

Commit b244225

Browse files
committed
cleaning up err logic
1 parent 7c341eb commit b244225

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/ext-proc/backend/pod_reconciler.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"strconv"
66

77
corev1 "k8s.io/api/core/v1"
8+
apierrors "k8s.io/apimachinery/pkg/api/errors"
89
"k8s.io/apimachinery/pkg/runtime"
910
"k8s.io/client-go/tools/record"
1011
"k8s.io/klog/v2"
@@ -36,8 +37,11 @@ func (c *PodReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.R
3637
pod := &corev1.Pod{}
3738
if err := c.Get(ctx, req.NamespacedName, pod); err != nil {
3839
klog.Error(err, ": unable to get pod")
39-
c.Datastore.pods.Delete(pod)
40-
return ctrl.Result{}, nil
40+
if apierrors.IsNotFound(err) {
41+
c.Datastore.pods.Delete(pod)
42+
return ctrl.Result{}, nil
43+
}
44+
return ctrl.Result{}, err
4145
}
4246

4347
c.updateDatastore(pod, inferencePool)

0 commit comments

Comments
 (0)