1
0
Fork 0

Add Support for Consul Connect

Co-authored-by: Florian Apolloner <apollo13@users.noreply.github.com>
This commit is contained in:
Mohammad Gufran 2021-07-15 17:32:11 +05:30 committed by GitHub
parent 3a180e2afc
commit 7e43e5615e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 2118 additions and 644 deletions

View file

@ -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
}