Explicitly cover only specific plan status for cleanup plans
This ensure that cleanup plans aren't (re-)started after a fatal error.
@@ -549,13 +549,13 @@ func getPlanToBeExecuted(i *v1beta1.Instance, ov *v1beta1.OperatorVersion) (*str
plan := kudov1beta1.SelectPlan([]string{v1beta1.CleanupPlanName}, ov)
if plan != nil {
if planStatus := i.PlanStatus(*plan); planStatus != nil {
- if !planStatus.Status.IsRunning() {
- if planStatus.Status.IsFinished() {
+ switch planStatus.Status {
+ case kudov1beta1.ExecutionNeverRun:
+ return plan, nil
+ case kudov1beta1.ExecutionComplete:
// we already finished the cleanup plan
return nil, nil
}
- return plan, nil
- }
}
}
}
