traefik/pkg/provider/ecs/label.go
Alessandro Chitolina 285ded6e49
Add AWS ECS provider
* add ecs provider

* add ecs docs

* fix test after rebase

* add provider icon

* add missing addProvider call

* Fix for review

* Fix documentation

* Fix for review

* Fix documentation

* fix ctx usage

* autoDiscoverClusters setDefaults false

* Fix for review

* review: doc.

* Fix for review: add ctx in backoff retry

* review: linter.

Co-authored-by: Michael <michael.matur@gmail.com>
Co-authored-by: romain <romain@containo.us>
Co-authored-by: Fernandez Ludovic <ludovic@containo.us>
2020-07-15 16:28:04 +02:00

24 lines
556 B
Go

package ecs
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(instance ecsInstance) (configuration, error) {
conf := configuration{
Enable: p.ExposedByDefault,
}
err := label.Decode(instance.Labels, &conf, "traefik.ecs.", "traefik.enable")
if err != nil {
return configuration{}, err
}
return conf, nil
}