Merge pull request #1548 from timoreimann/kubernetes-ignore-missing-pass-host-header-annotation

Merge v1.3 branch into master [2017-05-11]
This commit is contained in:
Ludovic Fernandez 2017-05-12 00:36:52 +02:00 committed by GitHub
commit b24b5e20b4

View file

@ -156,14 +156,16 @@ func (p *Provider) loadIngresses(k8sClient Client) (*types.Configuration, error)
PassHostHeader := p.getPassHostHeader() PassHostHeader := p.getPassHostHeader()
passHostHeaderAnnotation := i.Annotations["traefik.frontend.passHostHeader"] passHostHeaderAnnotation, ok := i.Annotations["traefik.frontend.passHostHeader"]
switch passHostHeaderAnnotation { switch {
case "true": case !ok:
PassHostHeader = true // No op.
case "false": case passHostHeaderAnnotation == "false":
PassHostHeader = false PassHostHeader = false
case passHostHeaderAnnotation == "true":
PassHostHeader = true
default: default:
log.Warnf("Unknown value of %s for traefik.frontend.passHostHeader, falling back to %s", passHostHeaderAnnotation, PassHostHeader) log.Warnf("Unknown value '%s' for traefik.frontend.passHostHeader, falling back to %s", passHostHeaderAnnotation, PassHostHeader)
} }
if realm := i.Annotations["ingress.kubernetes.io/auth-realm"]; realm != "" && realm != traefikDefaultRealm { if realm := i.Annotations["ingress.kubernetes.io/auth-realm"]; realm != "" && realm != traefikDefaultRealm {
return nil, errors.New("no realm customization supported") return nil, errors.New("no realm customization supported")