Add Consul Catalog provider
This commit is contained in:
parent
d0ed814669
commit
7be2db6e86
52 changed files with 4194 additions and 67 deletions
23
pkg/provider/consulcatalog/label.go
Normal file
23
pkg/provider/consulcatalog/label.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
package consulcatalog
|
||||
|
||||
import (
|
||||
"github.com/containous/traefik/v2/pkg/config/label"
|
||||
)
|
||||
|
||||
// configuration Contains information from the labels that are globals (not related to the dynamic configuration) or specific to the provider.
|
||||
type configuration struct {
|
||||
Enable bool
|
||||
}
|
||||
|
||||
func (p *Provider) getConfiguration(item itemData) (configuration, error) {
|
||||
conf := configuration{
|
||||
Enable: p.ExposedByDefault,
|
||||
}
|
||||
|
||||
err := label.Decode(item.Labels, &conf, "traefik.consulcatalog.", "traefik.enable")
|
||||
if err != nil {
|
||||
return configuration{}, err
|
||||
}
|
||||
|
||||
return conf, nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue