1
0
Fork 0

Add backwards compatibility

Signed-off-by: Emile Vauge <emile@vauge.com>
This commit is contained in:
Emile Vauge 2016-03-30 19:05:43 +02:00
parent 8737530a7d
commit bb072a1f8f
No known key found for this signature in database
GPG key ID: D808B4C167352E59
4 changed files with 32 additions and 9 deletions

View file

@ -152,12 +152,6 @@ func containerFilter(container docker.Container) bool {
return false
}
// labels, err := getLabels(container, []string{"traefik.frontend.rule"})
// if len(labels) != 0 && err != nil {
// log.Debugf("Filtering bad labeled container %s", container.Name)
// return false
// }
return true
}
@ -169,6 +163,15 @@ func (provider *Docker) getFrontendName(container docker.Container) string {
// GetFrontendRule returns the frontend rule for the specified container, using
// it's label. It returns a default one (Host) if the label is not present.
func (provider *Docker) getFrontendRule(container docker.Container) string {
// ⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠
// TODO: backwards compatibility with DEPRECATED rule.Value
if value, ok := container.Config.Labels["traefik.frontend.value"]; ok {
log.Warnf("Label traefik.frontend.value=%s is DEPRECATED, please refer to the rule label: https://github.com/containous/traefik/blob/master/docs/index.md#docker", value)
rule, _ := container.Config.Labels["traefik.frontend.rule"]
return rule + ":" + value
}
// ⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠⚠
if label, err := getLabel(container, "traefik.frontend.rule"); err == nil {
return label
}