Skip to content

feat: emit recovery event when reconciliation succeeds after failure - #1608

Closed
Iam-Karan-Suresh wants to merge 1 commit into
fluxcd:mainfrom
Iam-Karan-Suresh:fix/recovery-event-flux2-5738
Closed

Iam-Karan-Suresh wants to merge 1 commit into
fluxcd:mainfrom
Iam-Karan-Suresh:fix/recovery-event-flux2-5738

Conversation

@Iam-Karan-Suresh

Copy link
Copy Markdown
Contributor

Description

This PR addresses the "Ghost Failure" issue where a Kustomization that previously failed (sending a Red X to Git status) does not send a recovery event once the issue is resolved.

Following the implementation of RFC-0008, this change ensures that if a reconciliation succeeds and the object was previously in a non-ready state, an explicit Normal event is emitted with the commit-status: update metadata.

Changes

  • Snapshot the readiness state at the start of Reconcile.
  • Added a conditional check at the end of the success path to detect recovery.
  • Emitted an annotated event with eventv1.MetaCommitStatusKey to ensure notification-controller updates the Git commit status.

Testing

  1. Created a Kustomization pointing to a non-existent path (Verified Warning event and Red X in Git).
  2. Updated the Kustomization with the correct path.
  3. Verified a Normal event was emitted: "Reconciliation recovered from failure...".
  4. Verified Git status changed to Green Checkmark.

Part of: fluxcd/flux2#5738
Depends on: fluxcd/pkg#1087
Screenshot from 2026-03-01 23-05-22

Signed-off-by: Iam-karan-suresh <karansuresh.info@gmail.com>
@stefanprodan

Copy link
Copy Markdown
Member

The controller already emits a commit-status: update event on every successful reconciliation, so recovery is covered today and this change would send a duplicate event. For flux2#5738, what we need is a per-call-site check that each error event is followed by a success event once that failure is fixed, ideally with envtest coverage. If you find a call site where that doesn't happen, a targeted fix plus a test would be welcome. Closing this one for now.

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.

2 participants