Add health check label to ECS
This commit is contained in:
parent
4b91204686
commit
6d2f4a0813
7 changed files with 111 additions and 26 deletions
|
@ -195,6 +195,9 @@ func (p *Provider) generateECSConfig(services map[string][]ecsInstance) (*types.
|
|||
"getPassHostHeader": p.getPassHostHeader,
|
||||
"getPriority": p.getPriority,
|
||||
"getEntryPoints": p.getEntryPoints,
|
||||
"hasHealthCheckLabels": p.hasHealthCheckLabels,
|
||||
"getHealthCheckPath": p.getHealthCheckPath,
|
||||
"getHealthCheckInterval": p.getHealthCheckInterval,
|
||||
}
|
||||
return p.GetConfiguration("templates/ecs.tmpl", ecsFuncMap, struct {
|
||||
Services map[string][]ecsInstance
|
||||
|
@ -526,6 +529,18 @@ func (p *Provider) getLoadBalancerMethod(instances []ecsInstance) string {
|
|||
return "wrr"
|
||||
}
|
||||
|
||||
func (p *Provider) hasHealthCheckLabels(instances []ecsInstance) bool {
|
||||
return p.getHealthCheckPath(instances) != ""
|
||||
}
|
||||
|
||||
func (p *Provider) getHealthCheckPath(instances []ecsInstance) string {
|
||||
return p.getFirstInstanceLabel(instances, types.LabelBackendHealthcheckPath)
|
||||
}
|
||||
|
||||
func (p *Provider) getHealthCheckInterval(instances []ecsInstance) string {
|
||||
return p.getFirstInstanceLabel(instances, types.LabelBackendHealthcheckInterval)
|
||||
}
|
||||
|
||||
// Provider expects no more than 100 parameters be passed to a DescribeTask call; thus, pack
|
||||
// each string into an array capped at 100 elements
|
||||
func (p *Provider) chunkedTaskArns(tasks []*string) [][]*string {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue