Skip to content

Commit 7110b15

Browse files
authored
Implement close action with v2 hooks using a finalizer (#80)
* Implement close action with v2 hooks using a finalizer * 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.
1 parent 84985b7 commit 7110b15

13 files changed

Lines changed: 490 additions & 368 deletions

api/v1alpha1/nodedisruption_types.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,10 @@ type NodeDisruptionStatus struct {
101101
type DisruptedBudgetStatus struct {
102102
Reference NamespacedName `json:"reference,omitempty"`
103103
Reason string `json:"reason"`
104-
Preparing bool `json:"preparing"`
105-
Ok bool `json:"ok"`
104+
// Preparing is set to true when the application manager started preparation. Value is kept true even when the app is ready.
105+
Preparing bool `json:"preparing"`
106+
// Ok is set to true when application manager preparation is complete and ready for the NodeDisruption to continue.
107+
Ok bool `json:"ok"`
106108
}
107109

108110
//+kubebuilder:object:root=true

app_manager_openapi.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ paths:
128128
$ref: '#/responses/RetryAfter'
129129
default:
130130
$ref: '#/responses/UnexpectedError'
131-
/cancel:
131+
/close:
132132
post:
133-
summary: Cancel application preparation for a disruption.
134-
operationId: cancelPreparation
133+
summary: Notify the end of a disruption if the application needs to unprepare.
134+
operationId: closeDisruption
135135
tags:
136136
- disruption
137137
consumes:

internal/appmgrcli/disruption/cancel_preparation_parameters.go

Lines changed: 0 additions & 153 deletions
This file was deleted.

internal/appmgrcli/disruption/cancel_preparation_responses.go

Lines changed: 0 additions & 172 deletions
This file was deleted.

0 commit comments

Comments
 (0)