Skip to content

Commit

Permalink
Merge pull request #156 from joshbeard/api-spec-deletion
Browse files Browse the repository at this point in the history
specs: handle deletion when reading version
  • Loading branch information
joshbeard authored Aug 23, 2024
2 parents d93b515 + 828c150 commit 0911478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion readme/api_specification_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func (r *apiSpecResource) Read(ctx context.Context, req resource.ReadRequest, re
version: version,
})
if err != nil {
if strings.Contains(err.Error(), "API specification not found") {
if strings.Contains(err.Error(), "API specification not found") || strings.Contains(err.Error(), "no match for version ID") {
tflog.Warn(ctx, fmt.Sprintf("API specification %s not found. Removing from state.", state.ID.ValueString()))
resp.State.RemoveResource(ctx)

Expand Down

0 comments on commit 0911478

Please sign in to comment.