Skip to content

Commit

Permalink
fix resource deleted outside terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
adarobin committed Mar 18, 2024
1 parent 2f4531a commit 60ec700
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/provider/resource_host_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ func (r *HostRecordResource) Read(ctx context.Context, req resource.ReadRequest,
}

if *entity.Id == 0 {
data.ID = types.Int64Null()
resp.Diagnostics.Append(clientLogout(ctx, &client, mutex)...)
resp.State.RemoveResource(ctx)
return
}

Expand Down
3 changes: 1 addition & 2 deletions internal/provider/resource_ip4_address.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,8 @@ func (r *IP4AddressResource) Read(ctx context.Context, req resource.ReadRequest,
}

if *entity.Id == 0 {
data.ID = types.Int64Null()
resp.Diagnostics.Append(clientLogout(ctx, &client, mutex)...)
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
resp.State.RemoveResource(ctx)
return
}

Expand Down

0 comments on commit 60ec700

Please sign in to comment.