Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log on new artifact and failure recovery #759

Merged
merged 1 commit into from
Jun 3, 2022
Merged

Conversation

stefanprodan
Copy link
Member

Fix: #757

@darkowlzz
Copy link
Contributor

darkowlzz commented Jun 3, 2022

You can also add logs in the OCI helmrepo reconciler around

if !conditions.IsReady(oldObj) && conditions.IsReady(obj) {
r.Eventf(obj, corev1.EventTypeNormal, ready.Reason, ready.Message)
}
// Became not ready from ready.
if conditions.IsReady(oldObj) && !conditions.IsReady(obj) {
r.Eventf(obj, corev1.EventTypeWarning, ready.Reason, ready.Message)
}
.
These are a little different from the other reconcilers. It's triggered whenever the object toggles the ready state. I think it'd be good to log that as well.

UPDATE: Since the events around it are not annotated, you can just use r.eventLogf().

@darkowlzz
Copy link
Contributor

Result of this:

{
  "level": "info",
  "ts": "2022-06-03T18:41:33.477+0530",
  "logger": "controller.gitrepository",
  "msg": "stored artifact for commit 'Merge pull request #200 from stefanprodan/release-...'",
  "reconciler group": "source.toolkit.fluxcd.io",
  "reconciler kind": "GitRepository",
  "name": "podinfo",
  "namespace": "default"
}

Copy link
Contributor

@darkowlzz darkowlzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@stefanprodan stefanprodan merged commit ea1bab5 into main Jun 3, 2022
@stefanprodan stefanprodan deleted the log-on-new-artifact branch June 3, 2022 13:15
@stefanprodan stefanprodan mentioned this pull request Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No logs when an artefact is created or updated
2 participants