Skip to content

Commit

Permalink
do not scale in updated pods first
Browse files Browse the repository at this point in the history
  • Loading branch information
ColdsteelRail committed Jun 11, 2024
1 parent c7d63f4 commit a59eebf
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
5 changes: 0 additions & 5 deletions pkg/controllers/collaset/synccontrol/scale.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ func (s ActivePodsForDeletion) Less(i, j int) bool {
return r.ToDelete
}

// pods which are updated should be scaled in before not updated
if l.IsUpdated != r.IsUpdated {
return r.IsUpdated
}

// pods which are during scaleInOps should be deleted before those not during
lDuringScaleIn := podopslifecycle.IsDuringOps(collasetutils.ScaleInOpsLifecycleAdapter, l)
rDuringScaleIn := podopslifecycle.IsDuringOps(collasetutils.ScaleInOpsLifecycleAdapter, r)
Expand Down
1 change: 0 additions & 1 deletion pkg/controllers/collaset/synccontrol/sync_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ func (r *RealSyncControl) SyncPods(
ID: id,
ContextDetail: ownedIDs[id],
ToDelete: toDelete,
IsUpdated: collasetutils.IsPodUpdatedRevision(pod, resources.UpdatedRevision.Name),
})

if id >= 0 {
Expand Down
3 changes: 1 addition & 2 deletions pkg/controllers/collaset/utils/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ type PodWrapper struct {
ContextDetail *appsv1alpha1.ContextDetail

// TODO ToExclude
ToDelete bool
IsUpdated bool
ToDelete bool
}

func CollectPodInstanceID(pods []*PodWrapper) map[int]struct{} {
Expand Down

0 comments on commit a59eebf

Please sign in to comment.