1
0
Fork 0

Support Nomad canary deployment

Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
This commit is contained in:
Romain 2022-08-01 17:52:08 +02:00 committed by GitHub
parent ab94bbaece
commit 2a2ea759d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 593 additions and 51 deletions

View file

@ -4,17 +4,19 @@ import (
"github.com/traefik/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.
// 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
ConsulCatalog specificConfiguration
}
type specificConfiguration struct {
Connect bool
Connect bool // <prefix>.consulcatalog.connect is the corresponding label.
Canary bool // <prefix>.consulcatalog.canary is the corresponding label.
}
func (p *Provider) getConfiguration(labels map[string]string) (configuration, error) {
// getExtraConf returns a configuration with settings which are not part of the dynamic configuration (e.g. "<prefix>.enable").
func (p *Provider) getExtraConf(labels map[string]string) (configuration, error) {
conf := configuration{
Enable: p.ExposedByDefault,
ConsulCatalog: specificConfiguration{Connect: p.ConnectByDefault},