traefik/pkg/provider/rancher/label.go
Fernandez Ludovic 4c5e7a238d chore: go module
2019-08-12 05:06:04 -07:00

23 lines
419 B
Go

package rancher
import (
"github.com/containous/traefik/v2/pkg/config/label"
)
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")
if err != nil {
return configuration{}, err
}
return conf, nil
}