Skip to content

Commit

Permalink
Adds logs for new commit or error checking for the latest (#3182)
Browse files Browse the repository at this point in the history
Signed-off-by: Xavi Garcia <[email protected]>
  • Loading branch information
0xavi0 authored Jan 7, 2025
1 parent c41a446 commit 42f0d20
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,10 @@ func (r *GitJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
repoPolled, err := r.repoPolled(ctx, gitrepo)
if err != nil {
r.Recorder.Event(gitrepo, fleetevent.Warning, "FailedToCheckCommit", err.Error())
logger.Info("Failed to check for latest commit", "error", err)
} else if repoPolled && oldCommit != gitrepo.Status.Commit {
r.Recorder.Event(gitrepo, fleetevent.Normal, "GotNewCommit", gitrepo.Status.Commit)
logger.Info("New commit from repository", "newCommit", gitrepo.Status.Commit)
}

// check for webhook commit
Expand Down

0 comments on commit 42f0d20

Please sign in to comment.