Skip to content

Commit c0dddca

Browse files
committed
Continue UpgradeResourceState_Response implementation
UpgradeResourceState_Response was only returning diagnostics, and swallowing the incoming UpgradedState.
1 parent 01eb778 commit c0dddca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tfprotov5/internal/toproto/resource.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ func UpgradeResourceState_Response(in *tfprotov5.UpgradeResourceStateResponse) (
4141
if err != nil {
4242
return nil, err
4343
}
44-
return &tfplugin5.UpgradeResourceState_Response{
44+
resp := &tfplugin5.UpgradeResourceState_Response{
4545
Diagnostics: diags,
46-
}, nil
46+
}
47+
if in.UpgradedState != nil {
48+
resp.UpgradedState = DynamicValue(in.UpgradedState)
49+
}
50+
return resp, nil
4751
}
4852

4953
func ReadResource_Request(in *tfprotov5.ReadResourceRequest) (*tfplugin5.ReadResource_Request, error) {

0 commit comments

Comments
 (0)