From 1a20e9f9b4d129c27f0ff10ed4699ccd54fa728b Mon Sep 17 00:00:00 2001 From: Yves Peter Date: Mon, 12 Sep 2016 21:06:21 +0200 Subject: [PATCH] Kubernetes provider: don't log a warning if traefik.frontend.rule.type is empty, log namespace and ingress if invalide. --- provider/kubernetes.go | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/provider/kubernetes.go b/provider/kubernetes.go index 126499334..11141edf4 100644 --- a/provider/kubernetes.go +++ b/provider/kubernetes.go @@ -2,11 +2,6 @@ package provider import ( "fmt" - log "github.com/Sirupsen/logrus" - "github.com/containous/traefik/provider/k8s" - "github.com/containous/traefik/safe" - "github.com/containous/traefik/types" - "github.com/emilevauge/backoff" "io/ioutil" "os" "reflect" @@ -14,6 +9,12 @@ import ( "strings" "text/template" "time" + + log "github.com/Sirupsen/logrus" + "github.com/containous/traefik/provider/k8s" + "github.com/containous/traefik/safe" + "github.com/containous/traefik/types" + "github.com/emilevauge/backoff" ) const ( @@ -224,8 +225,10 @@ func (provider *Kubernetes) loadIngresses(k8sClient k8s.Client) (*types.Configur ruleType = "Path" case "pathprefix": ruleType = "PathPrefix" + case "": + ruleType = "PathPrefix" default: - log.Warnf("Unknown RuleType `%s`, falling back to `PathPrefix", ruleType) + log.Warnf("Unknown RuleType %s for %s/%s, falling back to PathPrefix", ruleType, i.ObjectMeta.Namespace, i.ObjectMeta.Name) ruleType = "PathPrefix" }