Place namespace before name in router key for Ingress
This commit is contained in:
parent
b4ee7bdcbe
commit
1576ad85b8
5 changed files with 25 additions and 25 deletions
|
@ -28,7 +28,7 @@
|
|||
"traefik"
|
||||
]
|
||||
},
|
||||
"test-ingress-default-whoami-test-whoami@kubernetes": {
|
||||
"default-test-ingress-whoami-test-whoami@kubernetes": {
|
||||
"entryPoints": [
|
||||
"web"
|
||||
],
|
||||
|
@ -92,7 +92,7 @@
|
|||
},
|
||||
"status": "enabled",
|
||||
"usedBy": [
|
||||
"test-ingress-default-whoami-test-whoami@kubernetes"
|
||||
"default-test-ingress-whoami-test-whoami@kubernetes"
|
||||
],
|
||||
"serverStatus": {
|
||||
"http://10.42.0.2:80": "UP",
|
||||
|
|
36
integration/testdata/rawdata-ingress.json
vendored
36
integration/testdata/rawdata-ingress.json
vendored
|
@ -28,18 +28,7 @@
|
|||
"traefik"
|
||||
]
|
||||
},
|
||||
"test-ingress-default-whoami-test-whoami@kubernetes": {
|
||||
"entryPoints": [
|
||||
"web"
|
||||
],
|
||||
"service": "default-whoami-http",
|
||||
"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
|
||||
"status": "enabled",
|
||||
"using": [
|
||||
"web"
|
||||
]
|
||||
},
|
||||
"test-ingress-https-default-whoami-test-https-whoami@kubernetes": {
|
||||
"default-test-ingress-https-whoami-test-https-whoami@kubernetes": {
|
||||
"entryPoints": [
|
||||
"web"
|
||||
],
|
||||
|
@ -50,7 +39,18 @@
|
|||
"web"
|
||||
]
|
||||
},
|
||||
"whoami-drop-route-default-whoami-test-drop-drop@kubernetes": {
|
||||
"default-test-ingress-whoami-test-whoami@kubernetes": {
|
||||
"entryPoints": [
|
||||
"web"
|
||||
],
|
||||
"service": "default-whoami-http",
|
||||
"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
|
||||
"status": "enabled",
|
||||
"using": [
|
||||
"web"
|
||||
]
|
||||
},
|
||||
"default-whoami-drop-route-whoami-test-drop-drop@kubernetes": {
|
||||
"entryPoints": [
|
||||
"web"
|
||||
],
|
||||
|
@ -61,7 +61,7 @@
|
|||
"web"
|
||||
]
|
||||
},
|
||||
"whoami-keep-route-default-whoami-test-keep-keep@kubernetes": {
|
||||
"default-whoami-keep-route-whoami-test-keep-keep@kubernetes": {
|
||||
"entryPoints": [
|
||||
"web"
|
||||
],
|
||||
|
@ -125,8 +125,8 @@
|
|||
},
|
||||
"status": "enabled",
|
||||
"usedBy": [
|
||||
"whoami-drop-route-default-whoami-test-drop-drop@kubernetes",
|
||||
"whoami-keep-route-default-whoami-test-keep-keep@kubernetes"
|
||||
"default-whoami-drop-route-whoami-test-drop-drop@kubernetes",
|
||||
"default-whoami-keep-route-whoami-test-keep-keep@kubernetes"
|
||||
],
|
||||
"serverStatus": {
|
||||
"http://XXXX": "UP",
|
||||
|
@ -147,8 +147,8 @@
|
|||
},
|
||||
"status": "enabled",
|
||||
"usedBy": [
|
||||
"test-ingress-default-whoami-test-whoami@kubernetes",
|
||||
"test-ingress-https-default-whoami-test-https-whoami@kubernetes"
|
||||
"default-test-ingress-https-whoami-test-https-whoami@kubernetes",
|
||||
"default-test-ingress-whoami-test-whoami@kubernetes"
|
||||
],
|
||||
"serverStatus": {
|
||||
"http://10.42.0.10:80": "UP",
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"traefik"
|
||||
]
|
||||
},
|
||||
"whoami-keep-route-default-whoami-test-keep-keep@kubernetes": {
|
||||
"default-whoami-keep-route-whoami-test-keep-keep@kubernetes": {
|
||||
"entryPoints": [
|
||||
"web"
|
||||
],
|
||||
|
@ -92,7 +92,7 @@
|
|||
},
|
||||
"status": "enabled",
|
||||
"usedBy": [
|
||||
"whoami-keep-route-default-whoami-test-keep-keep@kubernetes"
|
||||
"default-whoami-keep-route-whoami-test-keep-keep@kubernetes"
|
||||
],
|
||||
"serverStatus": {
|
||||
"http://10.42.0.4:80": "UP",
|
||||
|
|
|
@ -304,7 +304,7 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
|
|||
serviceName := provider.Normalize(ingress.Namespace + "-" + pa.Backend.Service.Name + "-" + portString)
|
||||
conf.HTTP.Services[serviceName] = service
|
||||
|
||||
routerKey := strings.TrimPrefix(provider.Normalize(ingress.Name+"-"+ingress.Namespace+"-"+rule.Host+pa.Path), "-")
|
||||
routerKey := strings.TrimPrefix(provider.Normalize(ingress.Namespace+"-"+ingress.Name+"-"+rule.Host+pa.Path), "-")
|
||||
routers[routerKey] = append(routers[routerKey], loadRouter(rule, pa, rtConfig, serviceName))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1696,7 +1696,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
|
|||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Middlewares: map[string]*dynamic.Middleware{},
|
||||
Routers: map[string]*dynamic.Router{
|
||||
"example-com-testing-bar": {
|
||||
"testing-example-com-bar": {
|
||||
Rule: "PathPrefix(`/bar`)",
|
||||
Service: "testing-service-bar-8080",
|
||||
},
|
||||
|
@ -1724,7 +1724,7 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
|
|||
HTTP: &dynamic.HTTPConfiguration{
|
||||
Middlewares: map[string]*dynamic.Middleware{},
|
||||
Routers: map[string]*dynamic.Router{
|
||||
"example-com-testing-foo": {
|
||||
"testing-example-com-foo": {
|
||||
Rule: "PathPrefix(`/foo`)",
|
||||
Service: "testing-service-foo-8080",
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue