Filter ECS tasks by LastStatus before adding to list of service tasks

This commit is contained in:
hwhelan-CB 2018-12-03 04:54:07 -05:00 committed by Traefiker Bot
parent e42ddfc3d6
commit 2f65572247

View file

@ -234,7 +234,9 @@ func (p *Provider) listInstances(ctx context.Context, client *awsClient) ([]ecsI
log.Errorf("Unable to describe tasks for %v", page.TaskArns)
} else {
for _, t := range resp.Tasks {
tasks[aws.StringValue(t.TaskArn)] = t
if aws.StringValue(t.LastStatus) == ecs.DesiredStatusRunning {
tasks[aws.StringValue(t.TaskArn)] = t
}
}
}
}