From decda1d620384a79c3426fee65d797c3844b0791 Mon Sep 17 00:00:00 2001 From: Ashutosh Singh Date: Mon, 24 Jun 2024 07:30:34 +0000 Subject: [PATCH] moved inside distributed --- pkg/gameserverallocations/find.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/gameserverallocations/find.go b/pkg/gameserverallocations/find.go index 4c234377b8..c1c1225994 100644 --- a/pkg/gameserverallocations/find.go +++ b/pkg/gameserverallocations/find.go @@ -40,9 +40,6 @@ func findGameServerForAllocation(gsa *allocationv1.GameServerAllocation, list [] var loop func(list []*agonesv1.GameServer, f func(i int, gs *agonesv1.GameServer)) - // Determine if Priorities are set in the Fleet spec - prioritiesSet := len(gsa.Spec.Priorities) > 0 - // packed is forward looping, distributed is random looping switch gsa.Spec.Scheduling { case apis.Packed: @@ -52,6 +49,9 @@ func findGameServerForAllocation(gsa *allocationv1.GameServerAllocation, list [] } } case apis.Distributed: + // Determine if Priorities are set in the Fleet spec + prioritiesSet := len(gsa.Spec.Priorities) > 0 + // randomised looping - make a list of indices, and then randomise them // as we don't want to change the order of the gameserver slice if !runtime.FeatureEnabled(runtime.FeatureCountsAndLists) || !prioritiesSet {