Tolerate InvalidInstanceID.NotFound when deleting instances

We treat as instance-already-deleted, i.e. not an error

Fix #592
This commit is contained in:
Justin Santa Barbara 2016-10-05 01:45:17 -04:00
parent a09f3a9dd2
commit 5137e2546e
1 changed files with 5 additions and 1 deletions

View File

@ -356,7 +356,11 @@ func DeleteInstance(cloud fi.Cloud, t *ResourceTracker) error {
}
_, err := c.EC2().TerminateInstances(request)
if err != nil {
return fmt.Errorf("error deleting instance %q: %v", id, err)
if awsup.AWSErrorCode(err) == "InvalidInstanceID.NotFound" {
glog.V(2).Infof("Got InvalidInstanceID.NotFound error deleting instance %q; will treat as already-deleted")
} else {
return fmt.Errorf("error deleting Instance %q: %v", id, err)
}
}
return nil
}