mirror of
https://github.com/traefik/traefik
synced 2026-02-03 12:20:33 +00:00
Fix mutually exclusive verification for Redis
This commit is contained in:
@@ -60,10 +60,20 @@ func (p *Provider) Init() error {
|
||||
}
|
||||
|
||||
if p.Sentinel != nil {
|
||||
switch {
|
||||
case p.Sentinel.LatencyStrategy && !(p.Sentinel.RandomStrategy || p.Sentinel.ReplicaStrategy):
|
||||
case p.Sentinel.RandomStrategy && !(p.Sentinel.LatencyStrategy || p.Sentinel.ReplicaStrategy):
|
||||
case p.Sentinel.ReplicaStrategy && !(p.Sentinel.RandomStrategy || p.Sentinel.LatencyStrategy):
|
||||
count := 0
|
||||
if p.Sentinel.LatencyStrategy {
|
||||
count++
|
||||
}
|
||||
|
||||
if p.Sentinel.ReplicaStrategy {
|
||||
count++
|
||||
}
|
||||
|
||||
if p.Sentinel.RandomStrategy {
|
||||
count++
|
||||
}
|
||||
|
||||
if count > 1 {
|
||||
return errors.New("latencyStrategy, randomStrategy and replicaStrategy options are mutually exclusive, please use only one of those options")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user