git: Update status after sync failure

This commit is contained in:
stefanprodan 2020-04-26 23:21:16 +03:00
parent 019d8f1215
commit 502a80b194
1 changed files with 3 additions and 0 deletions

View File

@ -79,6 +79,9 @@ func (r *GitRepositoryReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
syncedRepo, err := r.sync(ctx, *repo.DeepCopy())
if err != nil {
log.Error(err, "Git repository sync failed")
if err := r.Status().Update(ctx, &syncedRepo); err != nil {
log.Error(err, "unable to update GitRepository status")
}
return ctrl.Result{Requeue: true}, err
}