Skip to content

Commit

Permalink
NET-6385 - Static routes that are inlined in listener filters are als…
Browse files Browse the repository at this point in the history
…o created as a resource. (#19459)

* cover all protocols in local_app golden tests

* fix xds tests

* updating latest

* fix broken test

* add sorting of routers to TestBuildLocalApp to get rid of the flaking

* cover all protocols in local_app golden tests

* cover all protocols in local_app golden tests

* cover all protocols in local_app golden tests

* process envoy resource by walking the map.  use a map rather than array for envoy resource to prevent duplication.

* cleanup.  doc strings.

* update to latest

* fix broken test

* update tests after adding sorting of routers in local_app builder tests

* do not make endpoints for local_app

* fix catalog destinations only by creating clusters for any cluster not already created by walking the graph.

* Configure TestAllResourcesFromSnapshot to run V2 tests

* wip

* fix processing of failover groups

* add endpoints and clusters for any clusters that were not created from walking the listener -> path

* fix xds v2 golden files for clusters to include failover group clusters
  • Loading branch information
jmurret authored Nov 7, 2023
1 parent 2da7dd0 commit f115cdb
Show file tree
Hide file tree
Showing 27 changed files with 815 additions and 717 deletions.
2 changes: 1 addition & 1 deletion agent/xds/clusters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func makeClusterDiscoChainTests(enterprise bool) []clusterTestCase {
return proxycfg.TestConfigSnapshotDiscoveryChain(t, "failover", enterprise, nil, nil)
},
// TODO(proxystate): requires routes work
alsoRunTestForV2: false,
alsoRunTestForV2: true,
},
{
name: "connect-proxy-with-tcp-chain-failover-through-remote-gateway",
Expand Down
14 changes: 0 additions & 14 deletions agent/xds/endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,20 +247,6 @@ type endpointTestCase struct {

func makeEndpointDiscoChainTests(enterprise bool) []endpointTestCase {
return []endpointTestCase{
{
name: "connect-proxy-with-chain-and-overrides",
create: func(t testinf.T) *proxycfg.ConfigSnapshot {
return proxycfg.TestConfigSnapshotDiscoveryChain(t, "simple-with-overrides", enterprise, nil, nil)
},
alsoRunTestForV2: true,
},
{
name: "connect-proxy-with-chain-and-failover",
create: func(t testinf.T) *proxycfg.ConfigSnapshot {
return proxycfg.TestConfigSnapshotDiscoveryChain(t, "failover", enterprise, nil, nil)
},
alsoRunTestForV2: true,
},
{
name: "connect-proxy-with-tcp-chain-failover-through-remote-gateway",
create: func(t testinf.T) *proxycfg.ConfigSnapshot {
Expand Down
3 changes: 3 additions & 0 deletions agent/xds/proxystateconverter/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ func (s *Converter) makeUpstreamClustersForDiscoveryChain(
failoverGroup = &pbproxystate.FailoverGroup{
Config: &pbproxystate.FailoverGroupConfig{
ConnectTimeout: durationpb.New(node.Resolver.ConnectTimeout),
UseAltStatName: true,
},
}
}
Expand Down Expand Up @@ -927,6 +928,7 @@ func (s *Converter) makeUpstreamClustersForDiscoveryChain(
Group: &pbproxystate.EndpointGroup_Dynamic{
Dynamic: dynamic,
},
Name: groupedTarget.ClusterName,
}
endpointGroups = append(endpointGroups, eg)
} else {
Expand All @@ -940,6 +942,7 @@ func (s *Converter) makeUpstreamClustersForDiscoveryChain(
},
},
},
Name: mappedTargets.baseClusterName,
}

out[mappedTargets.baseClusterName] = cluster
Expand Down
16 changes: 0 additions & 16 deletions agent/xds/proxystateconverter/failover_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,22 +124,6 @@ func (s *Converter) mapDiscoChainTargets(cfgSnap *proxycfg.ConfigSnapshot, chain
Service: target.Service,
}.URI().String()}
}
//commonTLSContext := makeCommonTLSContext(
// cfgSnap.Leaf(),
// rootPEMs,
// makeTLSParametersFromProxyTLSConfig(cfgSnap.MeshConfigTLSOutgoing()),
//)
//
//err := injectSANMatcher(commonTLSContext, spiffeIDs...)
//if err != nil {
// return failoverTargets, fmt.Errorf("failed to inject SAN matcher rules for cluster %q: %v", sni, err)
//}

//tlsContext := &envoy_tls_v3.UpstreamTlsContext{
// CommonTlsContext: commonTLSContext,
// Sni: sni,
//}
//ti.TLSContext = tlsContext
failoverTargets.targets = append(failoverTargets.targets, ti)
}

Expand Down
Loading

0 comments on commit f115cdb

Please sign in to comment.