"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pkg/provider/ecs/config_test.go" between
traefik-v2.3.2.src.tar.gz and traefik-v2.3.3.src.tar.gz

About: Traefik is a cloud native edge router, a reverse proxy and load balancer for HTTP and TCP-based applications.

config_test.go  (traefik-v2.3.2.src):config_test.go  (traefik-v2.3.3.src)
skipping to change at line 1724 skipping to change at line 1724
}, },
}, },
}, },
{ {
desc: "one container with label port", desc: "one container with label port",
containers: []ecsInstance{ containers: []ecsInstance{
instance( instance(
name("Test"), name("Test"),
labels(map[string]string{ labels(map[string]string{
"traefik.http.services.Service1.L oadBalancer.server.scheme": "h2c", "traefik.http.services.Service1.L oadBalancer.server.scheme": "h2c",
"traefik.http.services.Service1.L oadBalancer.server.port": "8080", "traefik.http.services.Service1.L oadBalancer.server.port": "80",
}), }),
iMachine( iMachine(
mState(ec2.InstanceStateNameRunni ng), mState(ec2.InstanceStateNameRunni ng),
mPrivateIP("127.0.0.1"), mPrivateIP("127.0.0.1"),
mPorts( mPorts(
mPort(0, 80, "tcp"), mPort(80, 8080, "tcp"),
), ),
), ),
), ),
}, },
expected: &dynamic.Configuration{ expected: &dynamic.Configuration{
TCP: &dynamic.TCPConfiguration{ TCP: &dynamic.TCPConfiguration{
Routers: map[string]*dynamic.TCPRouter{} , Routers: map[string]*dynamic.TCPRouter{} ,
Services: map[string]*dynamic.TCPService{ }, Services: map[string]*dynamic.TCPService{ },
}, },
UDP: &dynamic.UDPConfiguration{ UDP: &dynamic.UDPConfiguration{
skipping to change at line 1768 skipping to change at line 1768
}, },
}, },
PassHostHeader: B ool(true), PassHostHeader: B ool(true),
}, },
}, },
}, },
}, },
}, },
}, },
{ {
desc: "one container with label port not exposed by conta
iner",
containers: []ecsInstance{
instance(
name("Test"),
labels(map[string]string{
"traefik.http.services.Service1.L
oadBalancer.server.scheme": "h2c",
"traefik.http.services.Service1.L
oadBalancer.server.port": "8040",
}),
iMachine(
mState(ec2.InstanceStateNameRunni
ng),
mPrivateIP("127.0.0.1"),
mPorts(
mPort(80, 8080, "tcp"),
),
),
),
},
expected: &dynamic.Configuration{
TCP: &dynamic.TCPConfiguration{
Routers: map[string]*dynamic.TCPRouter{}
,
Services: map[string]*dynamic.TCPService{
},
},
UDP: &dynamic.UDPConfiguration{
Routers: map[string]*dynamic.UDPRouter{}
,
Services: map[string]*dynamic.UDPService{
},
},
HTTP: &dynamic.HTTPConfiguration{
Routers: map[string]*dynamic.Router{
"Test": {
Service: "Service1",
Rule: "Host(`Test.trae
fik.wtf`)",
},
},
Middlewares: map[string]*dynamic.Middlewa
re{},
Services: map[string]*dynamic.Service{
"Service1": {
LoadBalancer: &dynamic.Se
rversLoadBalancer{
Servers: []dynami
c.Server{
{
U
RL: "h2c://127.0.0.1:8040",
},
},
PassHostHeader: B
ool(true),
},
},
},
},
},
},
{
desc: "one container with label and multiple ports",
containers: []ecsInstance{
instance(
name("Test"),
labels(map[string]string{
"traefik.http.routers.Test.rule":
"Host(`Test.traefik.wtf`)",
"traefik.http.routers.Test.servic
e": "Service1",
"traefik.http.services.Service1.L
oadBalancer.server.port": "4445",
"traefik.http.routers.Test2.rule"
: "Host(`Test.traefik.local`)",
"traefik.http.routers.Test2.servi
ce": "Service2",
"traefik.http.services.Service2.L
oadBalancer.server.port": "4444",
}),
iMachine(
mState(ec2.InstanceStateNameRunni
ng),
mPrivateIP("127.0.0.1"),
mPorts(
mPort(4444, 32123, "tcp")
,
mPort(4445, 32124, "tcp")
,
),
),
),
},
expected: &dynamic.Configuration{
TCP: &dynamic.TCPConfiguration{
Routers: map[string]*dynamic.TCPRouter{}
,
Services: map[string]*dynamic.TCPService{
},
},
UDP: &dynamic.UDPConfiguration{
Routers: map[string]*dynamic.UDPRouter{}
,
Services: map[string]*dynamic.UDPService{
},
},
HTTP: &dynamic.HTTPConfiguration{
Routers: map[string]*dynamic.Router{
"Test": {
Service: "Service1",
Rule: "Host(`Test.trae
fik.wtf`)",
},
"Test2": {
Service: "Service2",
Rule: "Host(`Test.trae
fik.local`)",
},
},
Middlewares: map[string]*dynamic.Middlewa
re{},
Services: map[string]*dynamic.Service{
"Service1": {
LoadBalancer: &dynamic.Se
rversLoadBalancer{
Servers: []dynami
c.Server{
{
U
RL: "http://127.0.0.1:32124",
},
},
PassHostHeader: B
ool(true),
},
},
"Service2": {
LoadBalancer: &dynamic.Se
rversLoadBalancer{
Servers: []dynami
c.Server{
{
U
RL: "http://127.0.0.1:32123",
},
},
PassHostHeader: B
ool(true),
},
},
},
},
},
},
{
desc: "one container with label port on two services", desc: "one container with label port on two services",
containers: []ecsInstance{ containers: []ecsInstance{
instance( instance(
name("Test"), name("Test"),
labels(map[string]string{ labels(map[string]string{
"traefik.http.services.Service1.L oadBalancer.server.port": "", "traefik.http.services.Service1.L oadBalancer.server.port": "",
"traefik.http.services.Service2.L oadBalancer.server.port": "8080", "traefik.http.services.Service2.L oadBalancer.server.port": "8080",
}), }),
iMachine( iMachine(
mState(ec2.InstanceStateNameRunni ng), mState(ec2.InstanceStateNameRunni ng),
skipping to change at line 2277 skipping to change at line 2396
}, },
}, },
{ {
desc: "tcp with label and port", desc: "tcp with label and port",
containers: []ecsInstance{ containers: []ecsInstance{
instance( instance(
name("Test"), name("Test"),
labels(map[string]string{ labels(map[string]string{
"traefik.tcp.routers.foo.rule": "HostSNI(`foo.bar`)", "traefik.tcp.routers.foo.rule": "HostSNI(`foo.bar`)",
"traefik.tcp.routers.foo.tls.opti ons": "foo", "traefik.tcp.routers.foo.tls.opti ons": "foo",
"traefik.tcp.services.foo.loadbal ancer.server.port": "8080", "traefik.tcp.services.foo.loadbal ancer.server.port": "80",
}), }),
iMachine( iMachine(
mState(ec2.InstanceStateNameRunni ng), mState(ec2.InstanceStateNameRunni ng),
mPrivateIP("127.0.0.1"), mPrivateIP("127.0.0.1"),
mPorts( mPorts(
mPort(0, 80, "tcp"), mPort(80, 8080, "tcp"),
), ),
), ),
), ),
}, },
expected: &dynamic.Configuration{ expected: &dynamic.Configuration{
TCP: &dynamic.TCPConfiguration{ TCP: &dynamic.TCPConfiguration{
Routers: map[string]*dynamic.TCPRouter{ Routers: map[string]*dynamic.TCPRouter{
"foo": { "foo": {
Service: "foo", Service: "foo",
Rule: "HostSNI(`foo.ba r`)", Rule: "HostSNI(`foo.ba r`)",
skipping to change at line 2330 skipping to change at line 2449
}, },
}, },
}, },
{ {
desc: "udp with label and port", desc: "udp with label and port",
containers: []ecsInstance{ containers: []ecsInstance{
instance( instance(
name("Test"), name("Test"),
labels(map[string]string{ labels(map[string]string{
"traefik.udp.routers.foo.entrypoi nts": "mydns", "traefik.udp.routers.foo.entrypoi nts": "mydns",
"traefik.udp.services.foo.loadbal ancer.server.port": "8080", "traefik.udp.services.foo.loadbal ancer.server.port": "80",
}), }),
iMachine( iMachine(
mState(ec2.InstanceStateNameRunni ng), mState(ec2.InstanceStateNameRunni ng),
mPrivateIP("127.0.0.1"), mPrivateIP("127.0.0.1"),
mPorts( mPorts(
mPort(0, 80, "udp"), mPort(80, 8080, "udp"),
), ),
), ),
), ),
}, },
expected: &dynamic.Configuration{ expected: &dynamic.Configuration{
UDP: &dynamic.UDPConfiguration{ UDP: &dynamic.UDPConfiguration{
Routers: map[string]*dynamic.UDPRouter{ Routers: map[string]*dynamic.UDPRouter{
"foo": { "foo": {
Service: "foo", Service: "foo",
EntryPoints: []string{"my dns"}, EntryPoints: []string{"my dns"},
skipping to change at line 2509 skipping to change at line 2628
Services: map[string]*dynamic.Service{ }, Services: map[string]*dynamic.Service{ },
}, },
}, },
}, },
{ {
desc: "tcp with label for tcp service, with termination d elay", desc: "tcp with label for tcp service, with termination d elay",
containers: []ecsInstance{ containers: []ecsInstance{
instance( instance(
name("Test"), name("Test"),
labels(map[string]string{ labels(map[string]string{
"traefik.tcp.services.foo.loadbal ancer.server.port": "8080", "traefik.tcp.services.foo.loadbal ancer.server.port": "80",
"traefik.tcp.services.foo.loadbal ancer.terminationdelay": "200", "traefik.tcp.services.foo.loadbal ancer.terminationdelay": "200",
}), }),
iMachine( iMachine(
mState(ec2.InstanceStateNameRunni ng), mState(ec2.InstanceStateNameRunni ng),
mPrivateIP("127.0.0.1"), mPrivateIP("127.0.0.1"),
mPorts( mPorts(
mPort(0, 80, "tcp"), mPort(80, 8080, "tcp"),
), ),
), ),
), ),
}, },
expected: &dynamic.Configuration{ expected: &dynamic.Configuration{
TCP: &dynamic.TCPConfiguration{ TCP: &dynamic.TCPConfiguration{
Routers: map[string]*dynamic.TCPRouter{}, Routers: map[string]*dynamic.TCPRouter{},
Services: map[string]*dynamic.TCPService{ Services: map[string]*dynamic.TCPService{
"foo": { "foo": {
LoadBalancer: &dynamic.TC PServersLoadBalancer{ LoadBalancer: &dynamic.TC PServersLoadBalancer{
 End of changes. 9 change blocks. 
8 lines changed or deleted 165 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)