Filter ingress class resources by name

Co-authored-by: SantoDE <manuel.zapf@traefik.io>
This commit is contained in:
Tom Moulard 2021-03-02 21:34:03 +01:00 committed by GitHub
parent 438eec720a
commit e658712d53
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 364 additions and 6 deletions

View file

@ -1273,6 +1273,35 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
},
},
},
{
desc: "v18 Ingress with ingressClasses filter",
serverVersion: "v1.18",
ingressClass: "traefik-lb2",
expected: &dynamic.Configuration{
TCP: &dynamic.TCPConfiguration{},
HTTP: &dynamic.HTTPConfiguration{
Middlewares: map[string]*dynamic.Middleware{},
Routers: map[string]*dynamic.Router{
"testing-foo": {
Rule: "PathPrefix(`/foo`)",
Service: "testing-service1-80",
},
},
Services: map[string]*dynamic.Service{
"testing-service1-80": {
LoadBalancer: &dynamic.ServersLoadBalancer{
PassHostHeader: Bool(true),
Servers: []dynamic.Server{
{
URL: "http://10.10.0.1:8080",
},
},
},
},
},
},
},
},
}
for _, test := range testCases {