Skip to content

Commit 17336c6

Browse files
committed
Fix Get and Put impl. in remote_grpc
1 parent 259f918 commit 17336c6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

internal/states/remote/remote_grpc.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ type grpcClient struct {
5353
// and returns a copy of the downloaded state data.
5454
//
5555
// Implementation of remote.Client
56-
func (g *grpcClient) Get() (*Payload, error) {
56+
func (g *grpcClient) Get() (*Payload, tfdiags.Diagnostics) {
5757
// TODO - replace with method implementation added to main branch
5858
req := providers.ReadStateBytesRequest{
5959
TypeName: g.typeName,
@@ -63,29 +63,29 @@ func (g *grpcClient) Get() (*Payload, error) {
6363

6464
if len(resp.Bytes) == 0 {
6565
// No state to return
66-
return nil, resp.Diagnostics.Err()
66+
return nil, resp.Diagnostics
6767
}
6868

6969
payload := &Payload{
7070
Data: resp.Bytes,
7171
MD5: []byte("foobar"),
7272
}
73-
return payload, resp.Diagnostics.Err()
73+
return payload, resp.Diagnostics
7474
}
7575

7676
// Put invokes the WriteStateBytes gRPC method in the plugin protocol
7777
// and to transfer state data to the remote location.
7878
//
7979
// Implementation of remote.Client
80-
func (g *grpcClient) Put(state []byte) error {
80+
func (g *grpcClient) Put(state []byte) tfdiags.Diagnostics {
8181
// TODO - replace with method implementation added to main branch
8282
req := providers.WriteStateBytesRequest{
8383
TypeName: g.typeName,
8484
StateId: g.stateId,
8585
}
8686
resp := g.provider.WriteStateBytes(req)
8787

88-
return resp.Diagnostics.Err()
88+
return resp.Diagnostics
8989
}
9090

9191
// Delete invokes the DeleteState gRPC method in the plugin protocol

0 commit comments

Comments
 (0)