Skip to content

fix: Reset ResourceSyncFailing condition to False on successful reconcile - #260

Merged
wikoion merged 2 commits into
mainfrom
wikoion/clear-failing-condition
Sep 2, 2026
Merged

fix: Reset ResourceSyncFailing condition to False on successful reconcile#260
wikoion merged 2 commits into
mainfrom
wikoion/clear-failing-condition

Conversation

@wikoion

@wikoion wikoion commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Sinker sets ResourceSyncFailing=True when a reconcile fails but never reliably clears it on success, so a single transient error can leave the condition latched forever. We've had alerts firing in starfleet on syncs that recovered seconds after the failure.

  • Successful reconciles now write an explicit ResourceSyncFailing=False condition instead of nulling the status. The old success path compared the computed status against the cached object, which skips the clearing patch when the cache is stale.
  • lastTransitionTime is only carried over while the condition value is unchanged, so a True<->False flip records a real transition.
  • Deleted resources keep their existing status so we don't patch objects whose finalizer has just been removed.
  • Reworked the transition time tests, the old assertion passed on any negative diff so the existing-condition case wasn't asserting anything.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The core success and deletion status-selection behavior lacks regression coverage.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Ensures recovered ResourceSync reconciliations clear stale failure conditions.

Changes:

  • Writes explicit success and failure conditions.
  • Preserves transition times only when status is unchanged.
  • Expands transition-time tests.
File summaries
File Description
src/controller.rs Updates condition handling and tests.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/controller.rs Outdated
@wikoion
wikoion marked this pull request as ready for review September 2, 2026 18:47
@wikoion
wikoion requested a review from a team as a code owner September 2, 2026 18:47
@wikoion
wikoion added this pull request to the merge queue Sep 2, 2026
Merged via the queue into main with commit 3e78504 Sep 2, 2026
3 checks passed
@wikoion
wikoion deleted the wikoion/clear-failing-condition branch September 2, 2026 18:50
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.

3 participants