Skip to content
This repository has been archived by the owner on Sep 15, 2023. It is now read-only.

Commit

Permalink
fix runtimetaskgroup reconcile: re-apply
Browse files Browse the repository at this point in the history
  • Loading branch information
pacoxu committed Jun 14, 2022
1 parent c1cbbc6 commit 472fee2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions controllers/runtimetaskgroup_reconcile.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,20 @@ func (a *taskGroupReconcileList) deriveViews() {
// Pending
a.pending = append(a.pending, v)
case v.planned == nil:
// Failed
if v.current.Status.ErrorReason != nil || v.current.Status.ErrorMessage != nil {
a.failed = append(a.failed, v)
continue
}
// Mark as Completed
if v.current.Status.CompletionTime != nil {
a.completed = append(a.completed, v)
continue
}
// Keep running
if v.current.Status.StartTime != nil {
a.running = append(a.running, v)
}
a.invalid = append(a.invalid, v)
}
}
Expand Down
4 changes: 4 additions & 0 deletions operations/upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ func planUpgrade(operation *operatorv1.Operation, spec *operatorv1.UpgradeOperat
},
},
)
log.Info("add upgrade-apply task group", "task", t1.Name)
items = append(items, t1)
}

Expand Down Expand Up @@ -126,6 +127,7 @@ func planUpgrade(operation *operatorv1.Operation, spec *operatorv1.UpgradeOperat
},
},
)
log.Info("add upgrade-cp task group", "task", t2.Name)
items = append(items, t2)
}

Expand All @@ -138,6 +140,7 @@ func planUpgrade(operation *operatorv1.Operation, spec *operatorv1.UpgradeOperat
},
},
)
log.Info("add upgrade-kube-proxy task group", "task", t3.Name)
items = append(items, t3)
}

Expand Down Expand Up @@ -176,6 +179,7 @@ func planUpgrade(operation *operatorv1.Operation, spec *operatorv1.UpgradeOperat
KubectlUncordon: &operatorv1.KubectlUncordonCommandSpec{},
},
)
log.Info("add upgrade-w task group", "task", t4.Name)
items = append(items, t4)
}

Expand Down

0 comments on commit 472fee2

Please sign in to comment.