Skip to content

short circuit suspension if deleting resource and it is not found#39

Merged
sourcehawk merged 4 commits into
mainfrom
fix/suspension-logic-shortcircuit
Mar 23, 2026
Merged

short circuit suspension if deleting resource and it is not found#39
sourcehawk merged 4 commits into
mainfrom
fix/suspension-logic-shortcircuit

Conversation

@sourcehawk
Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings March 22, 2026 23:50
Comment thread docs/component.md Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the component suspension workflow to avoid create→delete churn for resources configured with DeleteOnSuspend when the object is already absent from the cluster.

Changes:

  • Add a short-circuit in suspendResource to immediately treat absent DeleteOnSuspend resources as Suspended.
  • Add tests covering the new short-circuit behavior and error handling for failed existence checks.
  • Update suspension lifecycle documentation to describe the new behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
pkg/component/suspend.go Adds an existence check/early return for DeleteOnSuspend resources that are already NotFound during suspension.
pkg/component/suspend_test.go Adds new unit tests validating the early-return path and error propagation.
docs/component.md Documents creation-in-suspended-state behavior and the new DeleteOnSuspend “already absent” short-circuit.

Comment thread pkg/component/suspend.go
Comment thread pkg/component/suspend.go Outdated
Comment thread pkg/component/suspend.go
…hawk/operator-component-framework into fix/suspension-logic-shortcircuit
@sourcehawk sourcehawk merged commit 16c28f0 into main Mar 23, 2026
2 checks passed
@sourcehawk sourcehawk deleted the fix/suspension-logic-shortcircuit branch March 23, 2026 00:10
sourcehawk added a commit that referenced this pull request Mar 23, 2026
* short circuit suspension if deleting resource and it is not found
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