Skip to content

Implement close action with v2 hooks using a finalizer#80

Merged
jeremy-clerc merged 2 commits intomainfrom
close_disruption
Mar 4, 2026
Merged

Implement close action with v2 hooks using a finalizer#80
jeremy-clerc merged 2 commits intomainfrom
close_disruption

Conversation

@jeremy-clerc
Copy link
Copy Markdown
Contributor

  • Rename cancel to close as we not canceling preparation, just notifying that the node disruption has ended.
  • For each impacted budget of a node disruption we are calling the associated application disruption budget Close hook.

* Rename cancel to close as we not canceling preparation, just
  notifying that the node disruption has ended.
* For each impacted budget of a node disruption we are calling
  the associated application disruption budget Close hook.
Preparing bool `json:"preparing"`
Ok bool `json:"ok"`
// Preparing is set to true when the application manager started preparation. Value is kept true even when the app is ready.
Preparing bool `json:"preparing"`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if instead of having a boolean, an enum value with 3 state : Preparing / Ready / Closing wouldn't be more suitable.
Ok was legacy, so keeping it for retro-compatibility seems the right thing to do.

}

func (r *ApplicationDisruptionBudgetResolver) CallCancelHook(ctx context.Context, nd nodedisruptionv1alpha1.NodeDisruption, timeout time.Duration) error {
func (r *ApplicationDisruptionBudgetResolver) CallCloseHook(ctx context.Context, nd nodedisruptionv1alpha1.NodeDisruption, timeout time.Duration) error {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I find "terminate" verb more appropriate than "close" verb to terminate a NodeDisruption (terminate can be related to closing, deletion, cancellation, finish, ...)

@jeremy-clerc jeremy-clerc merged commit 7110b15 into main Mar 4, 2026
2 checks passed
@jeremy-clerc jeremy-clerc deleted the close_disruption branch March 4, 2026 08:25
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