From d4237c9d5962dd8048a2fdd2a07faef783d7212e Mon Sep 17 00:00:00 2001 From: Arek Rus <57007917+r-arek@users.noreply.github.com> Date: Fri, 28 Aug 2020 12:50:25 +0200 Subject: [PATCH] Fix for multiple vm's started by worker (#637) * Fix for multiple vm's started by worker * Update ec2.go * Update ec2.go * Update ec2.go Fix indentation Co-authored-by: Pavel Dotsulenko --- backend/ec2.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/backend/ec2.go b/backend/ec2.go index e3ed7d116..028d175c1 100644 --- a/backend/ec2.go +++ b/backend/ec2.go @@ -504,7 +504,7 @@ func (p *ec2Provider) Start(ctx gocontext.Context, startAttributes *StartAttribu } instances, lastErr = svc.DescribeInstances(describeInstancesInput) - if instances != nil { + if instances != nil && len(instances.Reservations) > 0 && len(instances.Reservations[0].Instances) > 0 { instance := instances.Reservations[0].Instances[0] address := *instance.PrivateIpAddress if instance.PublicIpAddress != nil && p.publicIPConnect { @@ -523,6 +523,9 @@ func (p *ec2Provider) Start(ctx gocontext.Context, startAttributes *StartAttribu instanceChan <- nil return } + if reservation.Instances[0].InstanceId != nil { + logger.Debugf("instance %s is not ready", *reservation.Instances[0].InstanceId) + } time.Sleep(500 * time.Millisecond) } }()