traefik/pkg/provider/rancher/label.go
Ludovic Fernandez 8d7eccad5d New static configuration loading system.
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
2019-06-17 11:48:05 +02:00

23 lines
449 B
Go

package rancher
import (
"github.com/containous/traefik/pkg/config/label"
)
type configuration struct {
Enable bool
Tags []string
}
func (p *Provider) getConfiguration(service rancherData) (configuration, error) {
conf := configuration{
Enable: p.ExposedByDefault,
}
err := label.Decode(service.Labels, &conf, "traefik.rancher.", "traefik.enable", "traefik.tags")
if err != nil {
return configuration{}, err
}
return conf, nil
}