Skip to content

Commit

Permalink
Fix usage of math.Min since the util method was removed (#5872)
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Lodovice <[email protected]>
  • Loading branch information
emanlodovice authored Apr 19, 2024
1 parent 8f6da89 commit fe105a9
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/ruler/ruler_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit fe105a9

Please sign in to comment.