@@ -129,6 +129,8 @@ const (
129129 ActionTypeEnableMaintenance ActionType = "EnableMaintenance"
130130 // ActionTypeEnableMaintenance disables maintenance on cluster.
131131 ActionTypeDisableMaintenance ActionType = "DisableMaintenance"
132+ // ActionTypeSetMaintenanceCondition sets maintenance condition.
133+ ActionTypeSetMaintenanceCondition ActionType = "SetMaintenanceCondition"
132134 // ActionTypeBootstrapUpdate update bootstrap status to true
133135 ActionTypeBootstrapUpdate ActionType = "BootstrapUpdate"
134136 // ActionTypeBootstrapSetPassword set password to the bootstrapped user
@@ -220,6 +222,11 @@ func (a Action) SetImage(image string) Action {
220222 return a
221223}
222224
225+ // AsPlan parse action list into plan
226+ func AsPlan (a []Action ) Plan {
227+ return a
228+ }
229+
223230// Plan is a list of actions that will be taken to update a deployment.
224231// Only 1 action is in progress at a time. The operator will wait for that
225232// action to be completely and then remove the action.
@@ -245,3 +252,38 @@ func (p Plan) Equal(other Plan) bool {
245252func (p Plan ) IsEmpty () bool {
246253 return len (p ) == 0
247254}
255+
256+ // Add add action at the end of plan
257+ func (p Plan ) After (action ... Action ) Plan {
258+ n := Plan {}
259+
260+ n = append (n , p ... )
261+
262+ n = append (n , action ... )
263+
264+ return n
265+ }
266+
267+ // Prefix add action at the beginning of plan
268+ func (p Plan ) Before (action ... Action ) Plan {
269+ n := Plan {}
270+
271+ n = append (n , action ... )
272+
273+ n = append (n , p ... )
274+
275+ return n
276+ }
277+
278+ // Prefix add action at the beginning of plan
279+ func (p Plan ) Wrap (before , after Action ) Plan {
280+ n := Plan {}
281+
282+ n = append (n , before )
283+
284+ n = append (n , p ... )
285+
286+ n = append (n , after )
287+
288+ return n
289+ }
0 commit comments