diff --git a/controllers/backup_controller.go b/controllers/backup_controller.go index 1bc26499..45685a88 100644 --- a/controllers/backup_controller.go +++ b/controllers/backup_controller.go @@ -85,7 +85,13 @@ func (r *BackupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr jobSyncer := backupSyncer.NewJobSyncer(r.Client, r.Scheme, backup) if err := syncer.Sync(ctx, jobSyncer, r.Recorder); err != nil { - return reconcile.Result{}, err + backup.UpdateStatusCondition(apiv1alpha1.BackupFailed, corev1.ConditionTrue, "CreateFailure", err.Error()) + backup.Status.Completed = true + if err2 := r.updateBackup(savedBackup, backup); err2 != nil { + return reconcile.Result{}, err2 + } + // Do not try again. + return reconcile.Result{}, nil } if err = r.updateBackup(savedBackup, backup); err != nil {