From fe105a9975d34ffbc9bf4d98e44dc07b8e98a162 Mon Sep 17 00:00:00 2001 From: Emmanuel Lodovice Date: Sat, 20 Apr 2024 02:30:14 +0800 Subject: [PATCH] Fix usage of math.Min since the util method was removed (#5872) Signed-off-by: Emmanuel Lodovice --- pkg/ruler/ruler_ring.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/ruler/ruler_ring.go b/pkg/ruler/ruler_ring.go index 7ab8f4c030..2658d6e8e3 100644 --- a/pkg/ruler/ruler_ring.go +++ b/pkg/ruler/ruler_ring.go @@ -11,7 +11,6 @@ import ( "github.com/cortexproject/cortex/pkg/ring" "github.com/cortexproject/cortex/pkg/ring/kv" "github.com/cortexproject/cortex/pkg/util/flagext" - utilmath "github.com/cortexproject/cortex/pkg/util/math" ) const ( @@ -146,7 +145,7 @@ func GetReplicationSetForListRule(r ring.ReadRing, cfg *RingConfig) (ring.Replic maxErrors := 0 maxUnavailableZones := 0 if cfg.ZoneAwarenessEnabled { - numReplicatedZones := utilmath.Min(len(ringZones), r.ReplicationFactor()) + numReplicatedZones := min(len(ringZones), r.ReplicationFactor()) // Given that quorum is not required, we only need at least one of the zone to be healthy to succeed. But we // also need to handle case when RF < number of zones. maxUnavailableZones = numReplicatedZones - 1