Add Rancher provider again
This commit is contained in:
parent
ed12366d52
commit
e1d097ea20
31 changed files with 2585 additions and 295 deletions
23
pkg/provider/rancher/label.go
Normal file
23
pkg/provider/rancher/label.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package rancher
|
||||
|
||||
import (
|
||||
"github.com/containous/traefik/pkg/provider/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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue