Add Support for Consul Connect
Co-authored-by: Florian Apolloner <apollo13@users.noreply.github.com>
This commit is contained in:
parent
3a180e2afc
commit
7e43e5615e
36 changed files with 2118 additions and 644 deletions
|
@ -6,15 +6,21 @@ import (
|
|||
|
||||
// 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
|
||||
Enable bool
|
||||
ConsulCatalog specificConfiguration
|
||||
}
|
||||
|
||||
func (p *Provider) getConfiguration(item itemData) (configuration, error) {
|
||||
type specificConfiguration struct {
|
||||
Connect bool
|
||||
}
|
||||
|
||||
func (p *Provider) getConfiguration(labels map[string]string) (configuration, error) {
|
||||
conf := configuration{
|
||||
Enable: p.ExposedByDefault,
|
||||
Enable: p.ExposedByDefault,
|
||||
ConsulCatalog: specificConfiguration{Connect: p.ConnectByDefault},
|
||||
}
|
||||
|
||||
err := label.Decode(item.Labels, &conf, "traefik.consulcatalog.", "traefik.enable")
|
||||
err := label.Decode(labels, &conf, "traefik.consulcatalog.", "traefik.enable")
|
||||
if err != nil {
|
||||
return configuration{}, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue