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 6aa040ad9f
commit 31b80683c8

View File

@@ -240,7 +240,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
}
}
}
}