Skip to content

Commit

Permalink
Allow deleting a non-existing subnet
Browse files Browse the repository at this point in the history
  • Loading branch information
odaira authored and hkantare committed Mar 26, 2020
1 parent c585c58 commit bea1803
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ibm/resource_ibm_is_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,13 @@ func resourceIBMISSubnetDelete(d *schema.ResourceData, meta interface{}) error {

subnet, err := subnetC.Get(d.Id())
if err != nil {
iserror, ok := err.(iserrors.RiaasError)
if ok {
if len(iserror.Payload.Errors) == 1 &&
iserror.Payload.Errors[0].Code == "not_found" {
return nil
}
}
return err
}

Expand Down

0 comments on commit bea1803

Please sign in to comment.