Skip to content

Commit 9af721f

Browse files
authored
Merge pull request #42 from fluxcd/fix-git-sync
git: Update status after sync failure
2 parents 019d8f1 + 502a80b commit 9af721f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

controllers/gitrepository_controller.go

+3
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ func (r *GitRepositoryReconciler) Reconcile(req ctrl.Request) (ctrl.Result, erro
7979
syncedRepo, err := r.sync(ctx, *repo.DeepCopy())
8080
if err != nil {
8181
log.Error(err, "Git repository sync failed")
82+
if err := r.Status().Update(ctx, &syncedRepo); err != nil {
83+
log.Error(err, "unable to update GitRepository status")
84+
}
8285
return ctrl.Result{Requeue: true}, err
8386
}
8487

0 commit comments

Comments
 (0)