Merge pull request #42 from fluxcd/fix-git-sync

git: Update status after sync failure
This commit is contained in:
Stefan Prodan 2020-04-27 11:14:50 +03:00 committed by GitHub
commit 9af721f431
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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
}