Skip to content

Commit

Permalink
Move the workaround of removing resource when empty ID up (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliang-akamai authored Sep 20, 2024
1 parent d63fc4c commit 2cf8c38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions linode/firewall/framework_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ func (r *Resource) Read(

ctx = populateLogAttributes(ctx, state)

// TODO: cleanup when Crossplane fixes it
if helper.FrameworkAttemptRemoveResourceForEmptyID(ctx, state.ID, resp) {
return
}

id := helper.FrameworkSafeStringToInt(state.ID.ValueString(), &resp.Diagnostics)
if resp.Diagnostics.HasError() {
return
Expand Down Expand Up @@ -127,11 +132,6 @@ func (r *Resource) Read(
refreshRules(ctx, client, id, &state, &resp.Diagnostics, false)
refreshDevices(ctx, client, id, &state, &resp.Diagnostics, false)

// TODO: cleanup when Crossplane fixes it
if helper.FrameworkAttemptRemoveResourceForEmptyID(ctx, state.ID, resp) {
return
}

resp.Diagnostics.Append(resp.State.Set(ctx, &state)...)
}

Expand Down

0 comments on commit 2cf8c38

Please sign in to comment.