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
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *Provider) getConfiguration(service rancherData) (configuration, error) {
|
|
|
|
conf := configuration{
|
|
|
|
Enable: p.ExposedByDefault,
|
|
|
|
}
|
|
|
|
|
2019-06-21 07:24:04 +00:00
|
|
|
err := label.Decode(service.Labels, &conf, "traefik.rancher.", "traefik.enable")
|
2019-04-05 10:22:04 +00:00
|
|
|
if err != nil {
|
|
|
|
return configuration{}, err
|
|
|
|
}
|
|
|
|
|
|
|
|
return conf, nil
|
|
|
|
}
|