1
0
Fork 0

Add support for ECS constraints

This commit is contained in:
Andrew Stucki 2018-06-29 17:14:03 -05:00 committed by Traefiker Bot
parent 11691019a0
commit 157e76e829
4 changed files with 35 additions and 0 deletions

View file

@ -87,6 +87,14 @@ func (p *Provider) filterInstance(i ecsInstance) bool {
return false
}
constraintTags := label.GetSliceStringValue(i.TraefikLabels, label.TraefikTags)
if ok, failingConstraint := p.MatchConstraints(constraintTags); !ok {
if failingConstraint != nil {
log.Debugf("Filtering ecs instance pruned by constraint %s (%s) (constraint = %q)", i.Name, i.ID, failingConstraint.String())
}
return false
}
return true
}