fix: add support for multiple ingress classes

This commit is contained in:
LandryBe 2021-01-28 15:08:04 +01:00 committed by GitHub
parent 49ec62c757
commit 9a931e4dc9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
53 changed files with 175 additions and 71 deletions

View file

@ -1061,6 +1061,38 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
},
},
},
{
desc: "v18 Ingress with multiple ingressClasses",
serverVersion: "v1.18",
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",
},
"testing-bar": {
Rule: "PathPrefix(`/bar`)",
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",
},
},
},
},
},
},
},
},
{
desc: "v18 Ingress with no pathType",
serverVersion: "v1.18",