Skip to content

Commit

Permalink
differnet fix
Browse files Browse the repository at this point in the history
  • Loading branch information
rboyer committed Aug 22, 2019
1 parent 080dc05 commit a69c0b9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 6 deletions.
15 changes: 14 additions & 1 deletion agent/proxycfg/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,12 @@ func TestGatewayServiceGroupFooDC1(t testing.T) structs.CheckServiceNodes {
// TestConfigSnapshot returns a fully populated snapshot
func TestConfigSnapshot(t testing.T) *ConfigSnapshot {
roots, leaf := TestCerts(t)

// no entries implies we'll get a default chain
dbChain := discoverychain.TestCompileConfigEntries(
t, "db", "default", "dc1",
connect.TestClusterID+".consul", "dc1", nil)

return &ConfigSnapshot{
Kind: structs.ServiceKindConnectProxy,
Service: "web-sidecar-proxy",
Expand All @@ -578,10 +584,17 @@ func TestConfigSnapshot(t testing.T) *ConfigSnapshot {
Roots: roots,
ConnectProxy: configSnapshotConnectProxy{
Leaf: leaf,
DiscoveryChain: map[string]*structs.CompiledDiscoveryChain{
"db": dbChain,
},
UpstreamEndpoints: map[string]structs.CheckServiceNodes{
"db": TestUpstreamNodes(t),
"prepared_query:geo-cache": TestUpstreamNodes(t),
},
WatchedUpstreamEndpoints: map[string]map[string]structs.CheckServiceNodes{
"db": map[string]structs.CheckServiceNodes{
"db.default.dc1": TestUpstreamNodes(t),
},
},
},
Datacenter: "dc1",
}
Expand Down
2 changes: 0 additions & 2 deletions agent/xds/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,6 @@ func (s *Server) makeUpstreamClustersForDiscoveryChain(
defaultCluster := out[0]

// Overlay what the user provided.
escapeHatchCluster.Name = defaultCluster.Name
escapeHatchCluster.AltStatName = defaultCluster.AltStatName
escapeHatchCluster.TlsContext = defaultCluster.TlsContext

out = []*envoy.Cluster{escapeHatchCluster}
Expand Down
8 changes: 7 additions & 1 deletion agent/xds/testdata/clusters/custom-local-app.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{
"@type": "type.googleapis.com/envoy.api.v2.Cluster",
"name": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"altStatName": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"type": "EDS",
"edsClusterConfig": {
"edsConfig": {
Expand All @@ -12,7 +13,7 @@
}
}
},
"connectTimeout": "1s",
"connectTimeout": "5s",
"tlsContext": {
"commonTlsContext": {
"tlsParams": {
Expand All @@ -38,6 +39,11 @@
},
"outlierDetection": {

},
"commonLbConfig": {
"healthyPanicThreshold": {

}
}
},
{
Expand Down
8 changes: 7 additions & 1 deletion agent/xds/testdata/clusters/custom-timeouts.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{
"@type": "type.googleapis.com/envoy.api.v2.Cluster",
"name": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"altStatName": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"type": "EDS",
"edsClusterConfig": {
"edsConfig": {
Expand All @@ -12,7 +13,7 @@
}
}
},
"connectTimeout": "2.345s",
"connectTimeout": "5s",
"tlsContext": {
"commonTlsContext": {
"tlsParams": {
Expand All @@ -38,6 +39,11 @@
},
"outlierDetection": {

},
"commonLbConfig": {
"healthyPanicThreshold": {

}
}
},
{
Expand Down
8 changes: 7 additions & 1 deletion agent/xds/testdata/clusters/defaults.golden
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{
"@type": "type.googleapis.com/envoy.api.v2.Cluster",
"name": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"altStatName": "db.default.dc1.internal.11111111-2222-3333-4444-555555555555.consul",
"type": "EDS",
"edsClusterConfig": {
"edsConfig": {
Expand All @@ -12,7 +13,7 @@
}
}
},
"connectTimeout": "1s",
"connectTimeout": "5s",
"tlsContext": {
"commonTlsContext": {
"tlsParams": {
Expand All @@ -38,6 +39,11 @@
},
"outlierDetection": {

},
"commonLbConfig": {
"healthyPanicThreshold": {

}
}
},
{
Expand Down

0 comments on commit a69c0b9

Please sign in to comment.