Skip to content

Commit

Permalink
Attacher continues retrying if pod not found
Browse files Browse the repository at this point in the history
  • Loading branch information
zqureshi authored and fntlnz committed Nov 18, 2020
1 parent 0457640 commit 231a618
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/attacher/attach.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 231a618

Please sign in to comment.