connect: remove support for Envoy 1.15

This commit is contained in:
Evan Culver 2021-09-22 11:48:50 -07:00
parent b877ad6e72
commit 88a899d06a
No known key found for this signature in database
GPG Key ID: 3BBE9838C95315C7
7 changed files with 22 additions and 93 deletions

View File

@ -792,14 +792,14 @@ jobs:
command: make test-coverage-ci
- run: *notify-slack-failure
envoy-integration-test-1_15_5: &ENVOY_TESTS
envoy-integration-test-1_16_5: &ENVOY_TESTS
docker:
# We only really need bash and docker-compose which is installed on all
# Circle images but pick Go since we have to pick one of them.
- image: *GOLANG_IMAGE
parallelism: 2
environment:
ENVOY_VERSION: "1.15.5"
ENVOY_VERSION: "1.16.5"
steps: &ENVOY_INTEGRATION_TEST_STEPS
- checkout
# Get go binary from workspace
@ -832,17 +832,6 @@ jobs:
path: *TEST_RESULTS_DIR
- run: *notify-slack-failure
envoy-integration-test-1_15_5-v2compat:
<<: *ENVOY_TESTS
environment:
ENVOY_VERSION: "1.15.5"
TEST_V2_XDS: "1"
envoy-integration-test-1_16_5:
<<: *ENVOY_TESTS
environment:
ENVOY_VERSION: "1.16.5"
envoy-integration-test-1_16_5-v2compat:
<<: *ENVOY_TESTS
environment:
@ -1104,12 +1093,6 @@ workflows:
- nomad-integration-0_8:
requires:
- dev-build
- envoy-integration-test-1_15_5:
requires:
- dev-build
- envoy-integration-test-1_15_5-v2compat:
requires:
- dev-build
- envoy-integration-test-1_16_5:
requires:
- dev-build

View File

@ -38,53 +38,24 @@ func (s *ResourceGenerator) clustersFromSnapshot(cfgSnap *proxycfg.ConfigSnapsho
if err != nil {
return nil, err
}
return s.maybeInjectStubClusterForGateways(res)
return res, nil
case structs.ServiceKindMeshGateway:
res, err := s.clustersFromSnapshotMeshGateway(cfgSnap)
if err != nil {
return nil, err
}
return s.maybeInjectStubClusterForGateways(res)
return res, nil
case structs.ServiceKindIngressGateway:
res, err := s.clustersFromSnapshotIngressGateway(cfgSnap)
if err != nil {
return nil, err
}
return s.maybeInjectStubClusterForGateways(res)
return res, nil
default:
return nil, fmt.Errorf("Invalid service kind: %v", cfgSnap.Kind)
}
}
func (s *ResourceGenerator) maybeInjectStubClusterForGateways(resources []proto.Message) ([]proto.Message, error) {
switch {
case !s.IncrementalXDS:
return resources, nil
case !s.ProxyFeatures.GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS:
return resources, nil
case len(resources) > 0:
return resources, nil
}
// For more justification for this hacky fix, check the comments associated
// with s.ProxyFeatures.GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS
const stubName = "consul-stub-cluster-working-around-envoy-bug-ignore"
return []proto.Message{
&envoy_cluster_v3.Cluster{
Name: stubName,
ConnectTimeout: ptypes.DurationProto(5 * time.Second),
ClusterDiscoveryType: &envoy_cluster_v3.Cluster_Type{Type: envoy_cluster_v3.Cluster_STATIC},
LoadAssignment: &envoy_endpoint_v3.ClusterLoadAssignment{
ClusterName: stubName,
Endpoints: []*envoy_endpoint_v3.LocalityLbEndpoints{
{LbEndpoints: []*envoy_endpoint_v3.LbEndpoint{}},
},
},
},
}, nil
}
// clustersFromSnapshot returns the xDS API representation of the "clusters"
// (upstreams) in the snapshot.
func (s *ResourceGenerator) clustersFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) {

View File

@ -310,12 +310,6 @@ func (s *Server) processDelta(stream ADSDeltaStream, reqCh <-chan *envoy_discove
}
if sent {
sentType[op.TypeUrl] = struct{}{}
if generator.ProxyFeatures.IncrementalXDSUpdatesMustBeSerial {
// For more justification for this hacky fix, check the
// comments associated with
// generator.ProxyFeatures.IncrementalXDSUpdatesMustBeSerial
break
}
}
}
}

View File

@ -1228,7 +1228,7 @@ func TestServer_DeltaAggregatedResources_v3_IngressEmptyResponse(t *testing.T) {
// REQ: clusters
envoy.SendDeltaReq(t, ClusterType, nil)
// RESP: clustesr
// RESP: cluster
assertDeltaResponseSent(t, envoy.deltaStream.sendCh, &envoy_discovery_v3.DeltaDiscoveryResponse{
TypeUrl: ClusterType,
Nonce: hexString(1),

View File

@ -11,10 +11,10 @@ import (
var (
// minSupportedVersion is the oldest mainline version we support. This should always be
// the zero'th point release of the last element of proxysupport.EnvoyVersions.
minSupportedVersion = version.Must(version.NewVersion("1.15.0"))
minSupportedVersion = version.Must(version.NewVersion("1.16.0"))
minVersionAllowingEmptyGatewayClustersWithIncrementalXDS = version.Must(version.NewVersion("1.16.0"))
minVersionAllowingMultipleIncrementalXDSChanges = version.Must(version.NewVersion("1.16.0"))
// add min version constraints for associated feature flags when necessary, for example:
// minVersionAllowingEmptyGatewayClustersWithIncrementalXDS = version.Must(version.NewVersion("1.16.0"))
specificUnsupportedVersions = []unsupportedVersion{}
)
@ -27,24 +27,15 @@ type unsupportedVersion struct {
type supportedProxyFeatures struct {
// add version dependent feature flags here
// GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS is needed to paper
// over some weird envoy behavior.
//
// For some reason Envoy versions prior to 1.16.0 when sent an empty CDS
// list via the incremental xDS protocol will correctly ack the message and
// just never request LDS resources.
GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS bool
// IncrementalXDSUpdatesMustBeSerial is needed to avoid an envoy crash.
// For example, we previously had flags for Envoy < 1.16 called:
//
// Versions of Envoy prior to 1.16.0 could crash if multiple in-flight
// changes to resources were happening during incremental xDS. To prevent
// that we force serial updates on those older versions.
// GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS
// IncrementalXDSUpdatesMustBeSerial
//
// issue: https://github.com/envoyproxy/envoy/issues/11877
// PR: https://github.com/envoyproxy/envoy/pull/12069
IncrementalXDSUpdatesMustBeSerial bool
// Which then manifested in the code for checks with this struct populated.
// By dropping support for 1.15, we no longer have any special flags here
// but leaving this flagging functionality for future one-offs.
}
func determineSupportedProxyFeatures(node *envoy_core_v3.Node) (supportedProxyFeatures, error) {
@ -82,13 +73,12 @@ func determineSupportedProxyFeaturesFromVersion(version *version.Version) (suppo
sf := supportedProxyFeatures{}
if version.LessThan(minVersionAllowingEmptyGatewayClustersWithIncrementalXDS) {
sf.GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS = true
}
if version.LessThan(minVersionAllowingMultipleIncrementalXDSChanges) {
sf.IncrementalXDSUpdatesMustBeSerial = true
}
// add version contraints to poipulate feature flags here when necessary, for example:
/*
if version.LessThan(minVersionAllowingEmptyGatewayClustersWithIncrementalXDS) {
sf.GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS = true
}
*/
return sf, nil
}

View File

@ -109,14 +109,7 @@ func TestDetermineSupportedProxyFeaturesFromString(t *testing.T) {
}
// Insert a bunch of valid versions.
for _, v := range []string{
"1.15.0", "1.15.1", "1.15.2", "1.15.3", "1.15.4", "1.15.5",
} {
cases[v] = testcase{expect: supportedProxyFeatures{
GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS: true,
IncrementalXDSUpdatesMustBeSerial: true,
}}
}
// Populate feature flags here when appropriate. See consul 1.10.x for reference.
for _, v := range []string{
"1.16.0", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5",
"1.17.0", "1.17.1", "1.17.2", "1.17.3", "1.17.4",

View File

@ -11,10 +11,8 @@ var EnvoyVersions = []string{
"1.18.4",
"1.17.4",
"1.16.5",
"1.15.5",
}
var EnvoyVersionsV2 = []string{
"1.16.5",
"1.15.5",
}