fix vs bug

This commit is contained in:
Jeff
2019-03-29 14:59:29 +08:00
committed by zryfish
parent 2e1dc6a7b5
commit 5392478077
2 changed files with 8 additions and 5 deletions

View File

@@ -79,16 +79,17 @@ func (dRule *DestinationRule) HasCircuitBreaker(namespace string, serviceName st
return false
}
// change circuit breaker to true only connectionPool and outlierDetection
// are both set
func isCircuitBreakerTrafficPolicy(trafficPolicy interface{}) bool {
if trafficPolicy == nil {
return false
}
if dTrafficPolicy, ok := trafficPolicy.(map[string]interface{}); ok {
if _, ok := dTrafficPolicy["connectionPool"]; ok {
return true
}
if _, ok := dTrafficPolicy["outlierDetection"]; ok {
return true
if _, ok := dTrafficPolicy["outlierDetection"]; ok {
return true
}
}
}
return false