Skip to content

Commit 49daeca

Browse files
author
Paddy
authored
Merge pull request #17 from mildwonkey/mildwonkey/upgrade-state-response
Continue UpgradeResourceState_Response implementation
2 parents 70efcad + 43a7497 commit 49daeca

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

tfprotov5/internal/fromproto/resource.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,13 @@ func UpgradeResourceStateResponse(in *tfplugin5.UpgradeResourceState_Response) (
4343
if err != nil {
4444
return nil, err
4545
}
46-
return &tfprotov5.UpgradeResourceStateResponse{
46+
resp := &tfprotov5.UpgradeResourceStateResponse{
4747
Diagnostics: diags,
48-
}, nil
48+
}
49+
if in.UpgradedState != nil {
50+
resp.UpgradedState = DynamicValue(in.UpgradedState)
51+
}
52+
return resp, nil
4953
}
5054

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

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)