Skip to content

Commit 3915845

Browse files
committed
Polish the logic
1 parent 873ce64 commit 3915845

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

pkg/controller/launcher-populator/populator.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,8 @@ func (ctl *controller) createLaunchers(ctx context.Context, node corev1.Node, ke
382382
func (ctl *controller) deleteExcessLaunchers(ctx context.Context, launchers []corev1.Pod, count int) error {
383383
logger := klog.FromContext(ctx)
384384

385-
expectedDeleteCount := min(len(launchers), count)
386-
387385
deletedCount := 0
388-
for i := 0; i < expectedDeleteCount && i < len(launchers); i++ {
386+
for i := 0; i < count && i < len(launchers); i++ {
389387
pod := launchers[len(launchers)-1-i]
390388

391389
// Check if the Pod is still in an unbound state

0 commit comments

Comments
 (0)