Ignore "unknown instance" error when rm instance

Fixes #4112

Signed-off-by: Jacob Parry <jacob@jacobparry.ca>
This commit is contained in:
Jacob Parry
2017-06-01 15:19:46 -04:00
parent d889abc352
commit 29bb630bae

View File

@@ -950,6 +950,11 @@ func (d *Driver) terminate() error {
_, err := d.getClient().TerminateInstances(&ec2.TerminateInstancesInput{
InstanceIds: []*string{&d.InstanceId},
})
if strings.HasPrefix(err.Error(), "unknown instance") {
return nil
}
if err != nil {
return fmt.Errorf("unable to terminate instance: %s", err)
}