|
|
|
@ -648,6 +648,12 @@ func TestStructs_NodeService_ValidateConnectProxy(t *testing.T) {
|
|
|
|
|
"Proxy.DestinationServiceName must be",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"connect-proxy: wildcard Proxy.DestinationServiceName",
|
|
|
|
|
func(x *NodeService) { x.Proxy.DestinationServiceName = "*" },
|
|
|
|
|
"Proxy.DestinationServiceName must not be",
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
"connect-proxy: valid Proxy.DestinationServiceName",
|
|
|
|
|
func(x *NodeService) { x.Proxy.DestinationServiceName = "hello" },
|
|
|
|
@ -697,6 +703,28 @@ func TestStructs_NodeService_ValidateConnectProxy(t *testing.T) {
|
|
|
|
|
},
|
|
|
|
|
"upstream destination name cannot be empty",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"connect-proxy: upstream wildcard name",
|
|
|
|
|
func(x *NodeService) {
|
|
|
|
|
x.Proxy.Upstreams = Upstreams{{
|
|
|
|
|
DestinationType: UpstreamDestTypeService,
|
|
|
|
|
DestinationName: WildcardSpecifier,
|
|
|
|
|
LocalBindPort: 5000,
|
|
|
|
|
}}
|
|
|
|
|
},
|
|
|
|
|
"upstream destination name cannot be a wildcard",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"connect-proxy: upstream can have wildcard name when centrally configured",
|
|
|
|
|
func(x *NodeService) {
|
|
|
|
|
x.Proxy.Upstreams = Upstreams{{
|
|
|
|
|
DestinationType: UpstreamDestTypeService,
|
|
|
|
|
DestinationName: WildcardSpecifier,
|
|
|
|
|
CentrallyConfigured: true,
|
|
|
|
|
}}
|
|
|
|
|
},
|
|
|
|
|
"",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"connect-proxy: upstream empty bind port",
|
|
|
|
|
func(x *NodeService) {
|
|
|
|
|