Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions agent/agent_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func TestAgent_Services_ExternalConnectProxy(t *testing.T) {
Port: 5000,
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "db",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
}
a.State.AddServiceWithChecks(srv1, nil, "", false)
Expand Down Expand Up @@ -226,7 +226,7 @@ func TestAgent_Services_Sidecar(t *testing.T) {
LocallyRegisteredAsSidecar: true,
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "db",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
Mode: structs.ProxyModeTransparent,
TransparentProxy: structs.TransparentProxyConfig{
OutboundListenerPort: 10101,
Expand Down
2 changes: 1 addition & 1 deletion agent/proxycfg/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func TestManager_BasicLifecycle(t *testing.T) {
})
}

upstreams := structs.TestUpstreams(t)
upstreams := structs.TestUpstreams(t, false)
for i := range upstreams {
upstreams[i].DestinationNamespace = structs.IntentionDefaultNamespace
upstreams[i].DestinationPartition = api.PartitionDefaultName
Expand Down
14 changes: 7 additions & 7 deletions agent/proxycfg/testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ func TestGatewayServiceGroupBarDC1(t testing.T) structs.CheckServiceNodes {
},
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "bar",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
},
},
Expand All @@ -573,7 +573,7 @@ func TestGatewayServiceGroupBarDC1(t testing.T) structs.CheckServiceNodes {
},
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "bar",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
},
},
Expand All @@ -594,7 +594,7 @@ func TestGatewayServiceGroupBarDC1(t testing.T) structs.CheckServiceNodes {
},
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "bar",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
},
},
Expand All @@ -620,7 +620,7 @@ func TestGatewayServiceGroupFooDC1(t testing.T) structs.CheckServiceNodes {
},
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "foo",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
},
},
Expand All @@ -641,7 +641,7 @@ func TestGatewayServiceGroupFooDC1(t testing.T) structs.CheckServiceNodes {
},
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "foo",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
},
},
Expand All @@ -662,7 +662,7 @@ func TestGatewayServiceGroupFooDC1(t testing.T) structs.CheckServiceNodes {
},
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "foo",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
},
},
Expand All @@ -683,7 +683,7 @@ func TestGatewayServiceGroupFooDC1(t testing.T) structs.CheckServiceNodes {
},
Proxy: structs.ConnectProxyConfig{
DestinationServiceName: "foo",
Upstreams: structs.TestUpstreams(t),
Upstreams: structs.TestUpstreams(t, false),
},
},
Checks: structs.HealthChecks{
Expand Down
2 changes: 1 addition & 1 deletion agent/proxycfg/testing_api_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestConfigSnapshotAPIGateway(
})
}

upstreams := structs.TestUpstreams(t)
upstreams := structs.TestUpstreams(t, false)

baseEvents = testSpliceEvents(baseEvents, setupTestVariationConfigEntriesAndSnapshot(
t, variation, upstreams, additionalEntries...,
Expand Down
14 changes: 11 additions & 3 deletions agent/proxycfg/testing_connect_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"github.com/mitchellh/go-testing-interface"
"github.com/stretchr/testify/assert"

"github.com/hashicorp/consul/acl"
"github.com/hashicorp/consul/agent/connect"
"github.com/hashicorp/consul/agent/consul/discoverychain"
"github.com/hashicorp/consul/agent/structs"
Expand All @@ -23,7 +24,7 @@ func TestConfigSnapshot(t testing.T, nsFn func(ns *structs.NodeService), extraUp
assert.True(t, dbChain.Default)

var (
upstreams = structs.TestUpstreams(t)
upstreams = structs.TestUpstreams(t, false)
dbUpstream = upstreams[0]
geoUpstream = upstreams[1]

Expand Down Expand Up @@ -93,19 +94,25 @@ func TestConfigSnapshot(t testing.T, nsFn func(ns *structs.NodeService), extraUp
func TestConfigSnapshotDiscoveryChain(
t testing.T,
variation string,
enterprise bool,
nsFn func(ns *structs.NodeService),
extraUpdates []UpdateEvent,
additionalEntries ...structs.ConfigEntry,
) *ConfigSnapshot {
roots, leaf := TestCerts(t)

var entMeta acl.EnterpriseMeta
if enterprise {
entMeta = acl.NewEnterpriseMetaWithPartition("ap1", "ns1")
}

var (
upstreams = structs.TestUpstreams(t)
upstreams = structs.TestUpstreams(t, enterprise)
geoUpstream = upstreams[1]

geoUID = NewUpstreamID(&geoUpstream)

webSN = structs.ServiceIDString("web", nil)
webSN = structs.ServiceIDString("web", &entMeta)
)

baseEvents := testSpliceEvents([]UpdateEvent{
Expand Down Expand Up @@ -157,6 +164,7 @@ func TestConfigSnapshotDiscoveryChain(
},
Meta: nil,
TaggedAddresses: nil,
EnterpriseMeta: entMeta,
}, nsFn, nil, testSpliceEvents(baseEvents, extraUpdates))
}

Expand Down
2 changes: 1 addition & 1 deletion agent/proxycfg/testing_ingress_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func TestConfigSnapshotIngressGateway(
},
}})

upstreams := structs.TestUpstreams(t)
upstreams := structs.TestUpstreams(t, false)
upstreams = structs.Upstreams{upstreams[0]} // just keep 'db'

baseEvents = testSpliceEvents(baseEvents, setupTestVariationConfigEntriesAndSnapshot(
Expand Down
Loading