mirror of https://github.com/status-im/consul.git
net-5689 fix disabling panic threshold logic (#18958)
This commit is contained in:
parent
5d0edec01f
commit
0a11499588
|
@ -5,13 +5,14 @@ package xds
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/hashicorp/consul/types"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
"testing"
|
||||
"text/template"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/consul/types"
|
||||
|
||||
envoy_cluster_v3 "github.com/envoyproxy/go-control-plane/envoy/config/cluster/v3"
|
||||
envoy_core_v3 "github.com/envoyproxy/go-control-plane/envoy/config/core/v3"
|
||||
envoy_tls_v3 "github.com/envoyproxy/go-control-plane/envoy/extensions/transport_sockets/tls/v3"
|
||||
|
|
|
@ -6,11 +6,12 @@ package proxystateconverter
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-uuid"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/go-hclog"
|
||||
"github.com/hashicorp/go-uuid"
|
||||
|
||||
envoy_endpoint_v3 "github.com/envoyproxy/go-control-plane/envoy/config/endpoint/v3"
|
||||
"google.golang.org/protobuf/types/known/durationpb"
|
||||
"google.golang.org/protobuf/types/known/wrapperspb"
|
||||
|
@ -312,7 +313,8 @@ func (s *Converter) makePassthroughClusters(cfgSnap *proxycfg.ConfigSnapshot) (m
|
|||
ConnectTimeout: durationpb.New(5 * time.Second),
|
||||
// Endpoints are managed separately by EDS
|
||||
// Having an empty config enables outlier detection with default config.
|
||||
OutlierDetection: &pbproxystate.OutlierDetection{},
|
||||
OutlierDetection: &pbproxystate.OutlierDetection{},
|
||||
DisablePanicThreshold: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -653,8 +655,7 @@ func (s *Converter) makeUpstreamClusterForPreparedQuery(upstream structs.Upstrea
|
|||
ConnectTimeout: durationpb.New(time.Duration(cfg.ConnectTimeoutMs) * time.Millisecond),
|
||||
// Endpoints are managed separately by EDS
|
||||
// Having an empty config enables outlier detection with default config.
|
||||
OutlierDetection: makeOutlierDetection(cfg.PassiveHealthCheck, nil, true),
|
||||
DisablePanicThreshold: true,
|
||||
OutlierDetection: makeOutlierDetection(cfg.PassiveHealthCheck, nil, true),
|
||||
CircuitBreakers: &pbproxystate.CircuitBreakers{
|
||||
UpstreamLimits: makeUpstreamLimitsIfNeeded(cfg.Limits),
|
||||
},
|
||||
|
@ -880,7 +881,8 @@ func (s *Converter) makeUpstreamClustersForDiscoveryChain(
|
|||
CircuitBreakers: &pbproxystate.CircuitBreakers{
|
||||
UpstreamLimits: makeUpstreamLimitsIfNeeded(upstreamConfig.Limits),
|
||||
},
|
||||
OutlierDetection: makeOutlierDetection(upstreamConfig.PassiveHealthCheck, nil, true),
|
||||
DisablePanicThreshold: true,
|
||||
OutlierDetection: makeOutlierDetection(upstreamConfig.PassiveHealthCheck, nil, true),
|
||||
},
|
||||
}
|
||||
ti := groupedTarget.Targets[0]
|
||||
|
|
|
@ -125,7 +125,7 @@ func (pr *ProxyResources) makeEnvoyDynamicCluster(name string, protocol string,
|
|||
cluster.AltStatName = name
|
||||
}
|
||||
cluster.ConnectTimeout = dynamic.Config.ConnectTimeout
|
||||
if !dynamic.Config.DisablePanicThreshold {
|
||||
if dynamic.Config.DisablePanicThreshold {
|
||||
cluster.CommonLbConfig = &envoy_cluster_v3.Cluster_CommonLbConfig{
|
||||
HealthyPanicThreshold: &envoy_type_v3.Percent{
|
||||
Value: 0, // disable panic threshold
|
||||
|
|
|
@ -11,6 +11,9 @@
|
|||
"resourceApiVersion": "V3"
|
||||
}
|
||||
},
|
||||
"commonLbConfig": {
|
||||
"healthyPanicThreshold": {}
|
||||
},
|
||||
"name": "tcp.api-1.default.dc1.internal.foo.consul",
|
||||
"transportSocket": {
|
||||
"name": "tls",
|
||||
|
|
Loading…
Reference in New Issue