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>
This commit is contained in:
parent
6e4f5821dc
commit
285ded6e49
19 changed files with 4348 additions and 0 deletions
23
pkg/provider/ecs/label.go
Normal file
23
pkg/provider/ecs/label.go
Normal file
|
@ -0,0 +1,23 @@
|
|||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue