Adding support for Traefik to respect the K8s ingress class annotation (#1182)

This commit is contained in:
Regner Blok-Andersen 2017-03-03 11:30:22 -08:00 committed by Timo Reimann
parent 38c0cf7007
commit f530284031
3 changed files with 57 additions and 1 deletions

View file

@ -1492,6 +1492,7 @@ func TestIngressAnnotations(t *testing.T) {
ObjectMeta: v1.ObjectMeta{
Namespace: "testing",
Annotations: map[string]string{
"kubernetes.io/ingress.class": "traefik",
"traefik.frontend.passHostHeader": "true",
},
},
@ -1516,6 +1517,34 @@ func TestIngressAnnotations(t *testing.T) {
},
},
},
{
ObjectMeta: v1.ObjectMeta{
Namespace: "testing",
Annotations: map[string]string{
"kubernetes.io/ingress.class": "somethingOtherThanTraefik",
},
},
Spec: v1beta1.IngressSpec{
Rules: []v1beta1.IngressRule{
{
Host: "herp",
IngressRuleValue: v1beta1.IngressRuleValue{
HTTP: &v1beta1.HTTPIngressRuleValue{
Paths: []v1beta1.HTTPIngressPath{
{
Path: "/derp",
Backend: v1beta1.IngressBackend{
ServiceName: "service2",
ServicePort: intstr.FromInt(80),
},
},
},
},
},
},
},
},
},
}
services := []*v1.Service{
{