mirror of https://github.com/status-im/consul.git
Merge pull request #11118 from hashicorp/eculver/remove-envoy-1.15
Remove support for Envoy 1.15
This commit is contained in:
commit
e808620463
|
@ -792,14 +792,14 @@ jobs:
|
||||||
command: make test-coverage-ci
|
command: make test-coverage-ci
|
||||||
- run: *notify-slack-failure
|
- run: *notify-slack-failure
|
||||||
|
|
||||||
envoy-integration-test-1_15_5: &ENVOY_TESTS
|
envoy-integration-test-1_16_5: &ENVOY_TESTS
|
||||||
docker:
|
docker:
|
||||||
# We only really need bash and docker-compose which is installed on all
|
# 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.
|
# Circle images but pick Go since we have to pick one of them.
|
||||||
- image: *GOLANG_IMAGE
|
- image: *GOLANG_IMAGE
|
||||||
parallelism: 2
|
parallelism: 2
|
||||||
environment:
|
environment:
|
||||||
ENVOY_VERSION: "1.15.5"
|
ENVOY_VERSION: "1.16.5"
|
||||||
steps: &ENVOY_INTEGRATION_TEST_STEPS
|
steps: &ENVOY_INTEGRATION_TEST_STEPS
|
||||||
- checkout
|
- checkout
|
||||||
# Get go binary from workspace
|
# Get go binary from workspace
|
||||||
|
@ -832,17 +832,6 @@ jobs:
|
||||||
path: *TEST_RESULTS_DIR
|
path: *TEST_RESULTS_DIR
|
||||||
- run: *notify-slack-failure
|
- 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-integration-test-1_16_5-v2compat:
|
||||||
<<: *ENVOY_TESTS
|
<<: *ENVOY_TESTS
|
||||||
environment:
|
environment:
|
||||||
|
@ -1104,12 +1093,6 @@ workflows:
|
||||||
- nomad-integration-0_8:
|
- nomad-integration-0_8:
|
||||||
requires:
|
requires:
|
||||||
- dev-build
|
- 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:
|
- envoy-integration-test-1_16_5:
|
||||||
requires:
|
requires:
|
||||||
- dev-build
|
- dev-build
|
||||||
|
|
|
@ -38,53 +38,24 @@ func (s *ResourceGenerator) clustersFromSnapshot(cfgSnap *proxycfg.ConfigSnapsho
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return s.maybeInjectStubClusterForGateways(res)
|
return res, nil
|
||||||
case structs.ServiceKindMeshGateway:
|
case structs.ServiceKindMeshGateway:
|
||||||
res, err := s.clustersFromSnapshotMeshGateway(cfgSnap)
|
res, err := s.clustersFromSnapshotMeshGateway(cfgSnap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return s.maybeInjectStubClusterForGateways(res)
|
return res, nil
|
||||||
case structs.ServiceKindIngressGateway:
|
case structs.ServiceKindIngressGateway:
|
||||||
res, err := s.clustersFromSnapshotIngressGateway(cfgSnap)
|
res, err := s.clustersFromSnapshotIngressGateway(cfgSnap)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return s.maybeInjectStubClusterForGateways(res)
|
return res, nil
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("Invalid service kind: %v", cfgSnap.Kind)
|
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"
|
// clustersFromSnapshot returns the xDS API representation of the "clusters"
|
||||||
// (upstreams) in the snapshot.
|
// (upstreams) in the snapshot.
|
||||||
func (s *ResourceGenerator) clustersFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) {
|
func (s *ResourceGenerator) clustersFromSnapshotConnectProxy(cfgSnap *proxycfg.ConfigSnapshot) ([]proto.Message, error) {
|
||||||
|
|
|
@ -310,12 +310,6 @@ func (s *Server) processDelta(stream ADSDeltaStream, reqCh <-chan *envoy_discove
|
||||||
}
|
}
|
||||||
if sent {
|
if sent {
|
||||||
sentType[op.TypeUrl] = struct{}{}
|
sentType[op.TypeUrl] = struct{}{}
|
||||||
if generator.ProxyFeatures.IncrementalXDSUpdatesMustBeSerial {
|
|
||||||
// For more justification for this hacky fix, check the
|
|
||||||
// comments associated with
|
|
||||||
// generator.ProxyFeatures.IncrementalXDSUpdatesMustBeSerial
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1228,7 +1228,7 @@ func TestServer_DeltaAggregatedResources_v3_IngressEmptyResponse(t *testing.T) {
|
||||||
// REQ: clusters
|
// REQ: clusters
|
||||||
envoy.SendDeltaReq(t, ClusterType, nil)
|
envoy.SendDeltaReq(t, ClusterType, nil)
|
||||||
|
|
||||||
// RESP: clustesr
|
// RESP: cluster
|
||||||
assertDeltaResponseSent(t, envoy.deltaStream.sendCh, &envoy_discovery_v3.DeltaDiscoveryResponse{
|
assertDeltaResponseSent(t, envoy.deltaStream.sendCh, &envoy_discovery_v3.DeltaDiscoveryResponse{
|
||||||
TypeUrl: ClusterType,
|
TypeUrl: ClusterType,
|
||||||
Nonce: hexString(1),
|
Nonce: hexString(1),
|
||||||
|
|
|
@ -11,10 +11,10 @@ import (
|
||||||
var (
|
var (
|
||||||
// minSupportedVersion is the oldest mainline version we support. This should always be
|
// minSupportedVersion is the oldest mainline version we support. This should always be
|
||||||
// the zero'th point release of the last element of proxysupport.EnvoyVersions.
|
// 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"))
|
// add min version constraints for associated feature flags when necessary, for example:
|
||||||
minVersionAllowingMultipleIncrementalXDSChanges = version.Must(version.NewVersion("1.16.0"))
|
// minVersionAllowingEmptyGatewayClustersWithIncrementalXDS = version.Must(version.NewVersion("1.16.0"))
|
||||||
|
|
||||||
specificUnsupportedVersions = []unsupportedVersion{}
|
specificUnsupportedVersions = []unsupportedVersion{}
|
||||||
)
|
)
|
||||||
|
@ -27,24 +27,15 @@ type unsupportedVersion struct {
|
||||||
|
|
||||||
type supportedProxyFeatures struct {
|
type supportedProxyFeatures struct {
|
||||||
// add version dependent feature flags here
|
// 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
|
// For example, we previously had flags for Envoy < 1.16 called:
|
||||||
// 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.
|
|
||||||
//
|
//
|
||||||
// Versions of Envoy prior to 1.16.0 could crash if multiple in-flight
|
// GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS
|
||||||
// changes to resources were happening during incremental xDS. To prevent
|
// IncrementalXDSUpdatesMustBeSerial
|
||||||
// that we force serial updates on those older versions.
|
|
||||||
//
|
//
|
||||||
// issue: https://github.com/envoyproxy/envoy/issues/11877
|
// Which then manifested in the code for checks with this struct populated.
|
||||||
// PR: https://github.com/envoyproxy/envoy/pull/12069
|
// By dropping support for 1.15, we no longer have any special flags here
|
||||||
IncrementalXDSUpdatesMustBeSerial bool
|
// but leaving this flagging functionality for future one-offs.
|
||||||
}
|
}
|
||||||
|
|
||||||
func determineSupportedProxyFeatures(node *envoy_core_v3.Node) (supportedProxyFeatures, error) {
|
func determineSupportedProxyFeatures(node *envoy_core_v3.Node) (supportedProxyFeatures, error) {
|
||||||
|
@ -82,13 +73,12 @@ func determineSupportedProxyFeaturesFromVersion(version *version.Version) (suppo
|
||||||
|
|
||||||
sf := supportedProxyFeatures{}
|
sf := supportedProxyFeatures{}
|
||||||
|
|
||||||
|
// add version constraints to populate feature flags here when necessary, for example:
|
||||||
|
/*
|
||||||
if version.LessThan(minVersionAllowingEmptyGatewayClustersWithIncrementalXDS) {
|
if version.LessThan(minVersionAllowingEmptyGatewayClustersWithIncrementalXDS) {
|
||||||
sf.GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS = true
|
sf.GatewaysNeedStubClusterWhenEmptyWithIncrementalXDS = true
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if version.LessThan(minVersionAllowingMultipleIncrementalXDSChanges) {
|
|
||||||
sf.IncrementalXDSUpdatesMustBeSerial = true
|
|
||||||
}
|
|
||||||
|
|
||||||
return sf, nil
|
return sf, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,17 +106,16 @@ func TestDetermineSupportedProxyFeaturesFromString(t *testing.T) {
|
||||||
"1.14.5": {expectErr: "Envoy 1.14.5 " + errTooOld},
|
"1.14.5": {expectErr: "Envoy 1.14.5 " + errTooOld},
|
||||||
"1.14.6": {expectErr: "Envoy 1.14.6 " + errTooOld},
|
"1.14.6": {expectErr: "Envoy 1.14.6 " + errTooOld},
|
||||||
"1.14.7": {expectErr: "Envoy 1.14.7 " + errTooOld},
|
"1.14.7": {expectErr: "Envoy 1.14.7 " + errTooOld},
|
||||||
|
"1.15.0": {expectErr: "Envoy 1.15.0 " + errTooOld},
|
||||||
|
"1.15.1": {expectErr: "Envoy 1.15.1 " + errTooOld},
|
||||||
|
"1.15.2": {expectErr: "Envoy 1.15.2 " + errTooOld},
|
||||||
|
"1.15.3": {expectErr: "Envoy 1.15.3 " + errTooOld},
|
||||||
|
"1.15.4": {expectErr: "Envoy 1.15.4 " + errTooOld},
|
||||||
|
"1.15.5": {expectErr: "Envoy 1.15.5 " + errTooOld},
|
||||||
}
|
}
|
||||||
|
|
||||||
// Insert a bunch of valid versions.
|
// Insert a bunch of valid versions.
|
||||||
for _, v := range []string{
|
// Populate feature flags here when appropriate. See consul 1.10.x for reference.
|
||||||
"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,
|
|
||||||
}}
|
|
||||||
}
|
|
||||||
for _, v := range []string{
|
for _, v := range []string{
|
||||||
"1.16.0", "1.16.1", "1.16.2", "1.16.3", "1.16.4", "1.16.5",
|
"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",
|
"1.17.0", "1.17.1", "1.17.2", "1.17.3", "1.17.4",
|
||||||
|
|
|
@ -11,10 +11,8 @@ var EnvoyVersions = []string{
|
||||||
"1.18.4",
|
"1.18.4",
|
||||||
"1.17.4",
|
"1.17.4",
|
||||||
"1.16.5",
|
"1.16.5",
|
||||||
"1.15.5",
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var EnvoyVersionsV2 = []string{
|
var EnvoyVersionsV2 = []string{
|
||||||
"1.16.5",
|
"1.16.5",
|
||||||
"1.15.5",
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue