Skip to content

Commit

Permalink
moved inside distributed
Browse files Browse the repository at this point in the history
  • Loading branch information
ashutosji committed Jul 14, 2024
1 parent 8101b2e commit decda1d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/gameserverallocations/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 {
Expand Down

0 comments on commit decda1d

Please sign in to comment.