Adjust ECS network interface detection logic

This commit is contained in:
Maxine Aubrey 2024-04-10 10:42:04 +02:00 committed by GitHub
parent 1a266c661a
commit 4e11bf3c38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -314,7 +314,7 @@ func (p *Provider) listInstances(ctx context.Context, client *awsClient) ([]ecsI
}
var mach *machine
if len(task.Attachments) != 0 {
if aws.StringValue(taskDef.NetworkMode) == "awsvpc" && len(task.Attachments) != 0 {
if len(container.NetworkInterfaces) == 0 {
logger.Errorf("Skip container %s: no network interfaces", aws.StringValue(container.Name))
continue