Skip to content

Commit

Permalink
Treat InvalidDhcpOptionsId.NotFound as already-deleted
Browse files Browse the repository at this point in the history
  • Loading branch information
wongma7 committed Dec 28, 2020
1 parent 784c4f0 commit 5bf1719
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/resources/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,9 @@ func DeleteDhcpOptions(cloud fi.Cloud, r *resources.Resource) error {
}
_, err := c.EC2().DeleteDhcpOptions(request)
if err != nil {
if IsDependencyViolation(err) {
if awsup.AWSErrorCode(err) == "InvalidDhcpOptionsID.NotFound" {
klog.V(2).Infof("Got InvalidDhcpOptionsID.NotFound error deleting DhcpOptions %q; will treat as already-deleted", id)
} else if IsDependencyViolation(err) {
return err
}
return fmt.Errorf("error deleting DhcpOptions %q: %v", id, err)
Expand Down

0 comments on commit 5bf1719

Please sign in to comment.