From d24f78222c6fb54e2f8ad2052f261145e8eacbba Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Mon, 6 Jan 2020 15:10:05 +0100 Subject: [PATCH] fix: skip ECS container when information are missing instead of panic. --- provider/ecs/ecs.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/provider/ecs/ecs.go b/provider/ecs/ecs.go index c3668e94e..89b028458 100644 --- a/provider/ecs/ecs.go +++ b/provider/ecs/ecs.go @@ -309,6 +309,11 @@ func (p *Provider) listInstances(ctx context.Context, client *awsClient) ([]ecsI state: aws.StringValue(task.LastStatus), } } else { + if containerInstance == nil { + log.Errorf("Unable to find container instance information for %s", aws.StringValue(container.Name)) + continue + } + var ports []portMapping for _, mapping := range container.NetworkBindings { if mapping != nil {