From 2cf8c38be7cb5afd4342fd5d7025894e99419782 Mon Sep 17 00:00:00 2001 From: Zhiwei Liang <121905282+zliang-akamai@users.noreply.github.com> Date: Fri, 20 Sep 2024 13:27:57 -0400 Subject: [PATCH] Move the workaround of removing resource when empty ID up (#1582) --- linode/firewall/framework_resource.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/linode/firewall/framework_resource.go b/linode/firewall/framework_resource.go index e9b9ce97a..b71254a84 100644 --- a/linode/firewall/framework_resource.go +++ b/linode/firewall/framework_resource.go @@ -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 @@ -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)...) }