Skip to content

Commit 565573f

Browse files
destory: ignore 404 on parameters (#139)
1 parent 4c7c882 commit 565573f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/provider/resources/space_parameter_resource.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package resources
33
import (
44
"context"
55
"fmt"
6+
"strings"
67

78
"github.com/hashicorp/terraform-plugin-framework/path"
89
"github.com/hashicorp/terraform-plugin-framework/resource"
@@ -174,6 +175,9 @@ func (r *TorqueSpaceParameterResource) Delete(ctx context.Context, req resource.
174175
// Delete the space.
175176
err := r.client.DeleteSpaceParameter(data.SpaceName.ValueString(), data.Name.ValueString())
176177
if err != nil {
178+
if strings.Contains(err.Error(), "status: 404") {
179+
return
180+
}
177181
resp.Diagnostics.AddError("Client Error", fmt.Sprintf("Unable to delete space parameter, got error: %s", err))
178182
return
179183
}

0 commit comments

Comments
 (0)