traefik/pkg/provider/rancher/label.go

23 lines
416 B
Go
Raw Normal View History

2019-04-05 10:22:04 +00:00
package rancher
import (
"github.com/traefik/traefik/v2/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,
}
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
}