Requeue reconcile if persist job output failed for any reason
We're seeing errors on some installs, where Kubernetes fails to provide
the containers STDOUT.
[#168510894](https://www.pivotaltracker.com/story/show/168510894)
@@ -103,8 +103,8 @@ func (r *ReconcileJob) Reconcile(request reconcile.Request) (reconcile.Result, e
ctxlog.WithEvent(&ej, "ExtendedJob").Infof(ctx, "Persisting output of job '%s'", instance.Name)
err = r.persistOutput(ctx, instance, ej)
if err != nil {
- ctxlog.WithEvent(instance, "PersistOutputError").Errorf(ctx, "Could not persist output: '%s'", err)
- return reconcile.Result{Requeue: false}, nil
+ err = ctxlog.WithEvent(instance, "PersistOutputError").Errorf(ctx, "Could not persist output: '%s'", err)
+ return reconcile.Result{Requeue: true}, err
}
} else if instance.Status.Failed == 1 && !ej.Spec.Output.WriteOnFailure {
ctxlog.WithEvent(&ej, "FailedPersistingOutput").Infof(ctx, "Will not persist output of job '%s' because it failed", instance.Name)
