mirror of https://github.com/kubernetes/kops.git
Tolerate InvalidInstanceID.NotFound when deleting instances
We treat as instance-already-deleted, i.e. not an error Fix #592
This commit is contained in:
parent
a09f3a9dd2
commit
5137e2546e
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue