Skip to content

Commit

Permalink
Merge pull request #10319 from hwoarang/tolerate-missing-detached-ec2
Browse files Browse the repository at this point in the history
Tolerate missing detached EC2 instances
  • Loading branch information
k8s-ci-robot authored Nov 26, 2020
2 parents d49ac34 + 0eb114d commit ead7143
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion upup/pkg/fi/cloudup/awsup/aws_cloud.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,11 @@ func deleteInstance(c AWSCloud, i *cloudinstances.CloudInstance) error {
}

if _, err := c.EC2().TerminateInstances(request); err != nil {
return fmt.Errorf("error deleting instance %q: %v", id, err)
if AWSErrorCode(err) == "InvalidInstanceID.NotFound" {
klog.V(2).Infof("Got InvalidInstanceID.NotFound error deleting instance %q; will treat as already-deleted", id)
} else {
return fmt.Errorf("error deleting instance %q: %v", id, err)
}
}

klog.V(8).Infof("deleted aws ec2 instance %q", id)
Expand Down

0 comments on commit ead7143

Please sign in to comment.