Skip to content

Commit d5519fd

Browse files
committed
fix tests + update dependencies
1 parent 74bb88d commit d5519fd

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

internal/framework5provider/move_state_resource.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ func (r MoveStateResource) Read(ctx context.Context, req resource.ReadRequest, r
7272
return
7373
}
7474

75+
// Unlike normal resources, this resource can't produce it's identity during read, but it's the same value
76+
// as the state value, so we can just use that to prevent any pass-through errors for versions of Terraform
77+
// that don't support identity.
78+
if req.Identity.Raw.IsNull() {
79+
resp.Diagnostics.Append(resp.Identity.SetAttribute(ctx, path.Root("id"), data.MovedRandomString)...)
80+
}
81+
7582
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
7683
}
7784

internal/framework6provider/move_state_resource.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,13 @@ func (r MoveStateResource) Read(ctx context.Context, req resource.ReadRequest, r
7272
return
7373
}
7474

75+
// Unlike normal resources, this resource can't produce it's identity during read, but it's the same value
76+
// as the state value, so we can just use that to prevent any pass-through errors for versions of Terraform
77+
// that don't support identity.
78+
if req.Identity.Raw.IsNull() {
79+
resp.Diagnostics.Append(resp.Identity.SetAttribute(ctx, path.Root("id"), data.MovedRandomString)...)
80+
}
81+
7582
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
7683
}
7784

0 commit comments

Comments
 (0)