net-5689 fix disabling panic threshold logic (#18958)

This commit is contained in:
Nitya Dhanushkodi 2023-09-21 15:52:30 -07:00 committed by GitHub
parent 5d0edec01f
commit 0a11499588
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 8 deletions

View File

@ -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"

View File

@ -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"
@ -313,6 +314,7 @@ func (s *Converter) makePassthroughClusters(cfgSnap *proxycfg.ConfigSnapshot) (m
// Endpoints are managed separately by EDS
// Having an empty config enables outlier detection with default config.
OutlierDetection: &pbproxystate.OutlierDetection{},
DisablePanicThreshold: true,
},
},
},
@ -654,7 +656,6 @@ func (s *Converter) makeUpstreamClusterForPreparedQuery(upstream structs.Upstrea
// Endpoints are managed separately by EDS
// Having an empty config enables outlier detection with default config.
OutlierDetection: makeOutlierDetection(cfg.PassiveHealthCheck, nil, true),
DisablePanicThreshold: true,
CircuitBreakers: &pbproxystate.CircuitBreakers{
UpstreamLimits: makeUpstreamLimitsIfNeeded(cfg.Limits),
},
@ -880,6 +881,7 @@ func (s *Converter) makeUpstreamClustersForDiscoveryChain(
CircuitBreakers: &pbproxystate.CircuitBreakers{
UpstreamLimits: makeUpstreamLimitsIfNeeded(upstreamConfig.Limits),
},
DisablePanicThreshold: true,
OutlierDetection: makeOutlierDetection(upstreamConfig.PassiveHealthCheck, nil, true),
},
}

View File

@ -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

View File

@ -11,6 +11,9 @@
"resourceApiVersion": "V3"
}
},
"commonLbConfig": {
"healthyPanicThreshold": {}
},
"name": "tcp.api-1.default.dc1.internal.foo.consul",
"transportSocket": {
"name": "tls",