Kubernetes provider: don't log a warning if traefik.frontend.rule.type is empty, log namespace and ingress if invalide.

This commit is contained in:
Yves Peter 2016-09-12 21:06:21 +02:00
parent 14d79e4eef
commit 1a20e9f9b4

View file

@ -2,11 +2,6 @@ package provider
import ( import (
"fmt" "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" "io/ioutil"
"os" "os"
"reflect" "reflect"
@ -14,6 +9,12 @@ import (
"strings" "strings"
"text/template" "text/template"
"time" "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 ( const (
@ -224,8 +225,10 @@ func (provider *Kubernetes) loadIngresses(k8sClient k8s.Client) (*types.Configur
ruleType = "Path" ruleType = "Path"
case "pathprefix": case "pathprefix":
ruleType = "PathPrefix" ruleType = "PathPrefix"
case "":
ruleType = "PathPrefix"
default: 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" ruleType = "PathPrefix"
} }