Skip to content

Commit

Permalink
enhancement (CollaSet): if Pod is not during updating, its update pro… (
Browse files Browse the repository at this point in the history
#41)

enhancement (CollaSet): if Pod is not during updating, its update progress needs not to be checked
  • Loading branch information
wu8685 committed Aug 21, 2023
1 parent 460d36b commit 3d9f496
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion pkg/controllers/collaset/synccontrol/sync_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,11 @@ func (sc *RealSyncControl) Update(set *appsv1alpha1.CollaSet, podWrapers []*coll
succCount, err = controllerutils.SlowStartBatch(len(podUpdateInfos), controllerutils.SlowStartInitialBatchSize, false, func(i int, _ error) error {
podInfo := podUpdateInfos[i]

// check Pod update is finished or not
if !podInfo.isDuringOps {
return nil
}

// check Pod is during updating, and it is finished or not
finished, msg, err := updater.GetPodUpdateFinishStatus(podInfo)
if err != nil {
return fmt.Errorf("fail to get pod %s/%s update finished: %s", podInfo.Namespace, podInfo.Name, err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/controllers/collaset/synccontrol/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ func (u *RecreatePodUpdater) AnalyseAndGetUpdatedPod(_ *appsv1alpha1.CollaSet, _
return false, false, nil, nil
}

func (u *RecreatePodUpdater) GetPodUpdateFinishStatus(podUpdateInfo *PodUpdateInfo) (finished bool, msg string, err error) {
func (u *RecreatePodUpdater) GetPodUpdateFinishStatus(podInfo *PodUpdateInfo) (finished bool, msg string, err error) {
// Recreate policy alway treat Pod as update finished
return podUpdateInfo.IsUpdatedRevision, "", nil
return podInfo.IsUpdatedRevision, "", nil
}

0 comments on commit 3d9f496

Please sign in to comment.