mirror of https://github.com/docker/docs.git
make sure the instance is actually running
- for example, in terminated state Docker-DCO-1.1-Signed-off-by: Aaron Feng aaron.feng@gmail.com (github: aaronfeng)
This commit is contained in:
parent
e91e665cc8
commit
361f9e6085
|
@ -175,7 +175,14 @@ func (c *ec2Client) findInstance() (instance *ec2.Instance, err error) {
|
||||||
if resp.Reservations == nil {
|
if resp.Reservations == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
return &resp.Reservations[0].Instances[0], nil
|
|
||||||
|
instance := resp.Reservations[0].Instances[0]
|
||||||
|
|
||||||
|
if (instance.State.Name != "running" || instance.State.Name != "pending") {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return &instance, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue