mirror of
https://github.com/traefik/traefik.git
synced 2026-05-05 12:26:25 +02:00
Fix mutually exclusive verification for Redis
This commit is contained in:
parent
1d445d5c9d
commit
278d903bb4
@ -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")
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user