Skip to content

Commit

Permalink
Explicitly cover only specific plan status for cleanup plans (#1358)
Browse files Browse the repository at this point in the history
This ensure that cleanup plans aren't (re-)started after a fatal error.

Signed-off-by: Jan Schlicht <jan@d2iq.com>
  • Loading branch information
Jan Schlicht committed Feb 25, 2020
1 parent 47853d3 commit 262a562
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/controller/instance/instance_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -549,12 +549,12 @@ 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() {
// we already finished the cleanup plan
return nil, nil
}
switch planStatus.Status {
case kudov1beta1.ExecutionNeverRun:
return plan, nil
case kudov1beta1.ExecutionComplete:
// we already finished the cleanup plan
return nil, nil
}
}
}
Expand Down

0 comments on commit 262a562

Please sign in to comment.