From a4576c60ece35d4a75bf8b1822652e7bce65353d Mon Sep 17 00:00:00 2001 From: ashutosji <108933935+ashutosji@users.noreply.github.com> Date: Mon, 15 Jul 2024 20:04:25 +0000 Subject: [PATCH] added condition for distributed logic (#3877) * added condition for distributed logic * moved inside distributed * added the inline suggestion --------- Co-authored-by: igooch --- pkg/gameserverallocations/find.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/gameserverallocations/find.go b/pkg/gameserverallocations/find.go index 3a0f23c8ba..01ed9ec5da 100644 --- a/pkg/gameserverallocations/find.go +++ b/pkg/gameserverallocations/find.go @@ -51,7 +51,7 @@ func findGameServerForAllocation(gsa *allocationv1.GameServerAllocation, list [] case apis.Distributed: // 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) { + if !runtime.FeatureEnabled(runtime.FeatureCountsAndLists) || len(gsa.Spec.Priorities) == 0 { l := len(list) indices := make([]int, l) for i := 0; i < l; i++ {