From 231a6181566cde6a72c56054ced5226fdc1bfc74 Mon Sep 17 00:00:00 2001 From: Zeeshan Qureshi Date: Tue, 17 Nov 2020 20:23:10 -0500 Subject: [PATCH] Attacher continues retrying if pod not found --- pkg/attacher/attach.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/attacher/attach.go b/pkg/attacher/attach.go index bf6856f..3d7eb44 100644 --- a/pkg/attacher/attach.go +++ b/pkg/attacher/attach.go @@ -68,7 +68,9 @@ func (a *Attacher) Attach(selector, namespace string) { } if len(pl.Items) == 0 { - return false, fmt.Errorf(podNotFoundError) + // A job might have been created but the pod scheduling could have been delayed + // therefore we cannot simply error out here and must continue retrying. + return false, nil } pod := &pl.Items[0] if pod.Status.Phase == corev1.PodSucceeded || pod.Status.Phase == corev1.PodFailed {