Correct BoltDB backend. Fixes #68

This commit is contained in:
emile 2015-10-23 18:59:08 +02:00
parent 32bfecff83
commit aaeb7cdffd
6 changed files with 11 additions and 7 deletions

View file

@ -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"

View file

@ -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).

1
kv.go
View file

@ -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 {

View file

@ -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"

View file

@ -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}}

View file

@ -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}}