Skip to content

Commit

Permalink
Fix kubernetes id name
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatur authored and traefiker committed Sep 13, 2019
1 parent 685c6dc commit 255e88f
Show file tree
Hide file tree
Showing 6 changed files with 255 additions and 251 deletions.
38 changes: 19 additions & 19 deletions integration/testdata/rawdata-crd.json
@@ -1,28 +1,28 @@
{
"routers": {
"default/test.route-6b204d94623b3df4370c@kubernetescrd": {
"default-test.route-6b204d94623b3df4370c@kubernetescrd": {
"entryPoints": [
"web"
],
"service": "default/test.route-6b204d94623b3df4370c",
"service": "default-test.route-6b204d94623b3df4370c",
"rule": "Host(`foo.com`) \u0026\u0026 PathPrefix(`/bar`)",
"priority": 12,
"tls": {
"options": "default/mytlsoption"
"options": "default-mytlsoption"
},
"status": "enabled",
"using": [
"web"
]
},
"default/test2.route-23c7f4c450289ee29016@kubernetescrd": {
"default-test2.route-23c7f4c450289ee29016@kubernetescrd": {
"entryPoints": [
"web"
],
"middlewares": [
"default/mychain@kubernetescrd"
"default-mychain@kubernetescrd"
],
"service": "default/test2.route-23c7f4c450289ee29016",
"service": "default-test2.route-23c7f4c450289ee29016",
"rule": "Host(`foo.com`) \u0026\u0026 PathPrefix(`/tobestripped`)",
"status": "enabled",
"using": [
Expand All @@ -31,18 +31,18 @@
}
},
"middlewares": {
"default/mychain@kubernetescrd": {
"default-mychain@kubernetescrd": {
"chain": {
"middlewares": [
"default/stripprefix@kubernetescrd"
"default-stripprefix@kubernetescrd"
]
},
"status": "enabled",
"usedBy": [
"default/test2.route-23c7f4c450289ee29016@kubernetescrd"
"default-test2.route-23c7f4c450289ee29016@kubernetescrd"
]
},
"default/stripprefix@kubernetescrd": {
"default-stripprefix@kubernetescrd": {
"stripPrefix": {
"prefixes": [
"/tobestripped"
Expand All @@ -52,7 +52,7 @@
}
},
"services": {
"default/test.route-6b204d94623b3df4370c@kubernetescrd": {
"default-test.route-6b204d94623b3df4370c@kubernetescrd": {
"loadBalancer": {
"servers": [
{
Expand All @@ -66,14 +66,14 @@
},
"status": "enabled",
"usedBy": [
"default/test.route-6b204d94623b3df4370c@kubernetescrd"
"default-test.route-6b204d94623b3df4370c@kubernetescrd"
],
"serverStatus": {
"http://10.42.0.2:80": "UP",
"http://10.42.0.6:80": "UP"
}
},
"default/test2.route-23c7f4c450289ee29016@kubernetescrd": {
"default-test2.route-23c7f4c450289ee29016@kubernetescrd": {
"loadBalancer": {
"servers": [
{
Expand All @@ -87,7 +87,7 @@
},
"status": "enabled",
"usedBy": [
"default/test2.route-23c7f4c450289ee29016@kubernetescrd"
"default-test2.route-23c7f4c450289ee29016@kubernetescrd"
],
"serverStatus": {
"http://10.42.0.2:80": "UP",
Expand All @@ -96,15 +96,15 @@
}
},
"tcpRouters": {
"default/test3.route-673acf455cb2dab0b43a@kubernetescrd": {
"default-test3.route-673acf455cb2dab0b43a@kubernetescrd": {
"entryPoints": [
"footcp"
],
"service": "default/test3.route-673acf455cb2dab0b43a",
"service": "default-test3.route-673acf455cb2dab0b43a",
"rule": "HostSNI(`*`)",
"tls": {
"passthrough": false,
"options": "default/mytlsoption"
"options": "default-mytlsoption"
},
"status": "enabled",
"using": [
Expand All @@ -113,7 +113,7 @@
}
},
"tcpServices": {
"default/test3.route-673acf455cb2dab0b43a@kubernetescrd": {
"default-test3.route-673acf455cb2dab0b43a@kubernetescrd": {
"loadBalancer": {
"terminationDelay": 100,
"servers": [
Expand All @@ -127,7 +127,7 @@
},
"status": "enabled",
"usedBy": [
"default/test3.route-673acf455cb2dab0b43a@kubernetescrd"
"default-test3.route-673acf455cb2dab0b43a@kubernetescrd"
]
}
}
Expand Down
20 changes: 10 additions & 10 deletions integration/testdata/rawdata-ingress.json
@@ -1,7 +1,7 @@
{
"routers": {
"whoami-test-https/whoami-tls@kubernetes": {
"service": "default/whoami/http",
"whoami-test-https-whoami-tls@kubernetes": {
"service": "default-whoami-http",
"rule": "Host(`whoami.test.https`) \u0026\u0026 PathPrefix(`/whoami`)",
"tls": {},
"status": "enabled",
Expand All @@ -10,17 +10,17 @@
"web"
]
},
"whoami-test-https/whoami@kubernetes": {
"service": "default/whoami/http",
"whoami-test-https-whoami@kubernetes": {
"service": "default-whoami-http",
"rule": "Host(`whoami.test.https`) \u0026\u0026 PathPrefix(`/whoami`)",
"status": "enabled",
"using": [
"traefik",
"web"
]
},
"whoami-test/whoami@kubernetes": {
"service": "default/whoami/http",
"whoami-test-whoami@kubernetes": {
"service": "default-whoami-http",
"rule": "Host(`whoami.test`) \u0026\u0026 PathPrefix(`/whoami`)",
"status": "enabled",
"using": [
Expand All @@ -30,7 +30,7 @@
}
},
"services": {
"default/whoami/http@kubernetes": {
"default-whoami-http@kubernetes": {
"loadBalancer": {
"servers": [
{
Expand All @@ -44,9 +44,9 @@
},
"status": "enabled",
"usedBy": [
"whoami-test-https/whoami-tls@kubernetes",
"whoami-test-https/whoami@kubernetes",
"whoami-test/whoami@kubernetes"
"whoami-test-https-whoami-tls@kubernetes",
"whoami-test-https-whoami@kubernetes",
"whoami-test-whoami@kubernetes"
],
"serverStatus": {
"http://10.42.0.2:80": "UP",
Expand Down
2 changes: 1 addition & 1 deletion pkg/provider/kubernetes/crd/kubernetes.go
Expand Up @@ -511,7 +511,7 @@ func makeID(namespace, name string) string {
return name
}

return namespace + "/" + name
return namespace + "-" + name
}

func shouldProcessIngress(ingressClass string, ingressClassAnnotation string) bool {
Expand Down

0 comments on commit 255e88f

Please sign in to comment.