From aaeb7cdffdfc290de66c7b3dc00eaf8805bf08e1 Mon Sep 17 00:00:00 2001 From: emile Date: Fri, 23 Oct 2015 18:59:08 +0200 Subject: [PATCH] Correct BoltDB backend. Fixes #68 --- docker.go | 4 ++-- docs/index.md | 3 +++ kv.go | 1 + marathon.go | 4 ++-- templates/docker.tmpl | 4 ++-- templates/marathon.tmpl | 2 +- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/docker.go b/docker.go index bef97ba8c..77a1f6f73 100644 --- a/docker.go +++ b/docker.go @@ -99,8 +99,8 @@ func (provider *DockerProvider) loadDockerConfig(dockerClient *docker.Client) *C } return provider.Domain }, - "getProtocole": func(container docker.Container) string { - if label, err := provider.getLabel(container, "traefik.protocole"); err == nil { + "getProtocol": func(container docker.Container) string { + if label, err := provider.getLabel(container, "traefik.protocol"); err == nil { return label } return "http" diff --git a/docs/index.md b/docs/index.md index f13ebe1d8..743215fc4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -407,6 +407,7 @@ Labels can be used on containers to override default behaviour: - `traefik.backend=foo`: assign the container to `foo` backend - `traefik.port=80`: register this port. Useful when the container exposes multiples ports. +- `traefik.protocol=https`: override the default `http` protocol - `traefik.weight=10`: assign this weight to the container - `traefik.enable=false`: disable this container in Træfɪk - `traefik.frontend.rule=Host`: override the default frontend rule (Default: Host). See [frontends](#frontends). @@ -466,7 +467,9 @@ domain = "marathon.localhost" Labels can be used on containers to override default behaviour: +- `traefik.backend=foo`: assign the application to `foo` backend - `traefik.port=80`: register this port. Useful when the application exposes multiples ports. +- `traefik.protocol=https`: override the default `http` protocol - `traefik.weight=10`: assign this weight to the application - `traefik.enable=false`: disable this application in Træfɪk - `traefik.frontend.rule=Host`: override the default frontend rule (Default: Host). See [frontends](#frontends). diff --git a/kv.go b/kv.go index afe240d13..44ab3401b 100644 --- a/kv.go +++ b/kv.go @@ -88,6 +88,7 @@ func (provider *KvProvider) provide(configurationChan chan<- configMessage) erro []string{provider.Endpoint}, &store.Config{ ConnectionTimeout: 30 * time.Second, + Bucket: "traefik", }, ) if err != nil { diff --git a/marathon.go b/marathon.go index f3e345344..4d9271e69 100644 --- a/marathon.go +++ b/marathon.go @@ -83,13 +83,13 @@ func (provider *MarathonProvider) loadMarathonConfig() *Configuration { "replace": func(s1 string, s2 string, s3 string) string { return strings.Replace(s3, s1, s2, -1) }, - "getProtocole": func(task marathon.Task, applications []marathon.Application) string { + "getProtocol": func(task marathon.Task, applications []marathon.Application) string { application := getApplication(task, applications) if application == nil { log.Errorf("Unable to get marathon application from task %s", task.AppID) return "http" } - if label, err := provider.getLabel(*application, "traefik.protocole"); err == nil { + if label, err := provider.getLabel(*application, "traefik.protocol"); err == nil { return label } return "http" diff --git a/templates/docker.tmpl b/templates/docker.tmpl index 60da39130..4aba4e124 100644 --- a/templates/docker.tmpl +++ b/templates/docker.tmpl @@ -1,6 +1,6 @@ [backends]{{range .Containers}} [backends.backend-{{getBackend .}}.servers.server-{{.Name | replace "/" "" | replace "." "-"}}] - url = "{{getProtocole .}}://{{.NetworkSettings.IPAddress}}:{{getPort .}}" + url = "{{getProtocol .}}://{{.NetworkSettings.IPAddress}}:{{getPort .}}" weight = {{getWeight .}} {{end}} @@ -10,4 +10,4 @@ [frontends."frontend-{{$frontend}}".routes."route-frontend-{{$frontend}}"] rule = "{{getFrontendRule $container}}" value = "{{getFrontendValue $container}}" -{{end}} \ No newline at end of file +{{end}} diff --git a/templates/marathon.tmpl b/templates/marathon.tmpl index ba491ac47..e79d792c9 100644 --- a/templates/marathon.tmpl +++ b/templates/marathon.tmpl @@ -1,7 +1,7 @@ {{$apps := .Applications}} [backends]{{range .Tasks}} [backends.backend{{.AppID | replace "/" "-"}}.servers.server-{{.ID | replace "." "-"}}] - url = "{{getProtocole . $apps}}://{{.Host}}:{{getPort .}}" + url = "{{getProtocol . $apps}}://{{.Host}}:{{getPort .}}" weight = {{getWeight . $apps}} {{end}}