diff --git a/agent/xds/clusters_test.go b/agent/xds/clusters_test.go index 8bbb0958a043b..f0b37768f348f 100644 --- a/agent/xds/clusters_test.go +++ b/agent/xds/clusters_test.go @@ -407,49 +407,41 @@ func TestClustersFromSnapshot(t *testing.T) { }, }, { - name: "ingress-with-service-max-connections", - create: func(t testinf.T) *proxycfg.ConfigSnapshot { - return proxycfg.TestConfigSnapshotIngressGateway(t, true, "tcp", - "simple", nil, - func(entry *structs.IngressGatewayConfigEntry) { - entry.Listeners[0].Services[0].MaxConnections = 4096 - }, nil) - }, - }, - { - name: "ingress-with-defaults-service-max-connections", - create: func(t testinf.T) *proxycfg.ConfigSnapshot { - return proxycfg.TestConfigSnapshotIngressGateway(t, true, "tcp", - "simple", nil, - func(entry *structs.IngressGatewayConfigEntry) { - entry.Defaults = &structs.IngressServiceConfig{ - MaxConnections: 2048, - MaxPendingRequests: 512, - MaxConcurrentRequests: 4096, - } - }, nil) + name: "ingress-with-service-max-connections", + create: proxycfg.TestConfigSnapshotIngress, + setup: func(snap *proxycfg.ConfigSnapshot) { + key := proxycfg.IngressListenerKey{ + Protocol: "tcp", + Port: 9191, + } + snap.IngressGateway.Listeners[key].Services[0].MaxConnections = 4096 }, }, { - name: "ingress-with-overwrite-defaults-service-max-connections", - create: func(t testinf.T) *proxycfg.ConfigSnapshot { - return proxycfg.TestConfigSnapshotIngressGateway(t, true, "tcp", - "simple", nil, - func(entry *structs.IngressGatewayConfigEntry) { - entry.Defaults = &structs.IngressServiceConfig{ - MaxConnections: 2048, - MaxPendingRequests: 512, - } - entry.Listeners[0].Services[0].MaxConnections = 4096 - entry.Listeners[0].Services[0].MaxPendingRequests = 2048 - }, nil) + name: "ingress-with-defaults-service-max-connections", + create: proxycfg.TestConfigSnapshotIngress, + setup: func(snap *proxycfg.ConfigSnapshot) { + snap.IngressGateway.Defaults = structs.IngressServiceConfig{ + MaxConnections: 2048, + MaxPendingRequests: 512, + MaxConcurrentRequests: 4096, + } }, }, { - name: "ingress-with-chain-external-sni", - create: func(t testinf.T) *proxycfg.ConfigSnapshot { - return proxycfg.TestConfigSnapshotIngressGateway(t, true, "tcp", - "external-sni", nil, nil, nil) + name: "ingress-with-overwrite-defaults-service-max-connections", + create: proxycfg.TestConfigSnapshotIngress, + setup: func(snap *proxycfg.ConfigSnapshot) { + snap.IngressGateway.Defaults = structs.IngressServiceConfig{ + MaxConnections: 2048, + MaxPendingRequests: 512, + } + key := proxycfg.IngressListenerKey{ + Protocol: "tcp", + Port: 9191, + } + snap.IngressGateway.Listeners[key].Services[0].MaxConnections = 4096 + snap.IngressGateway.Listeners[key].Services[0].MaxPendingRequests = 2048 }, }, { diff --git a/agent/xds/testdata/clusters/ingress-with-defaults-service-max-connections.latest.golden b/agent/xds/testdata/clusters/ingress-with-defaults-service-max-connections.envoy-1-20-x.golden similarity index 100% rename from agent/xds/testdata/clusters/ingress-with-defaults-service-max-connections.latest.golden rename to agent/xds/testdata/clusters/ingress-with-defaults-service-max-connections.envoy-1-20-x.golden diff --git a/agent/xds/testdata/clusters/ingress-with-overwrite-defaults-service-max-connections.latest.golden b/agent/xds/testdata/clusters/ingress-with-overwrite-defaults-service-max-connections.envoy-1-20-x.golden similarity index 100% rename from agent/xds/testdata/clusters/ingress-with-overwrite-defaults-service-max-connections.latest.golden rename to agent/xds/testdata/clusters/ingress-with-overwrite-defaults-service-max-connections.envoy-1-20-x.golden diff --git a/agent/xds/testdata/clusters/ingress-with-service-max-connections.latest.golden b/agent/xds/testdata/clusters/ingress-with-service-max-connections.envoy-1-20-x.golden similarity index 100% rename from agent/xds/testdata/clusters/ingress-with-service-max-connections.latest.golden rename to agent/xds/testdata/clusters/ingress-with-service-max-connections.envoy-1-20-x.golden