2019-04-05 10:22:04 +00:00
|
|
|
package rancher
|
|
|
|
|
|
|
|
import (
|
2019-06-17 09:48:05 +00:00
|
|
|
"github.com/containous/traefik/pkg/config/label"
|
2019-04-05 10:22:04 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|