forked from TrueCloudLab/frostfs-api-go
[#142] sdk/container: Add converters to and from v2
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
012cea1add
commit
3c7c363002
2 changed files with 22 additions and 10 deletions
|
@ -100,7 +100,7 @@ func (c Client) putContainerV2(ctx context.Context, cnr *container.Container, op
|
|||
}
|
||||
|
||||
reqBody := new(v2container.PutRequestBody)
|
||||
reqBody.SetContainer(&cnr.Container)
|
||||
reqBody.SetContainer(cnr.ToV2())
|
||||
|
||||
// sign container
|
||||
signWrapper := v2signature.StableMarshalerWrapper{SM: reqBody.GetContainer()}
|
||||
|
@ -182,9 +182,7 @@ func (c Client) getContainerV2(ctx context.Context, id *container.ID, opts ...Ca
|
|||
return nil, errors.Wrap(err, "can't verify response message")
|
||||
}
|
||||
|
||||
return &container.Container{
|
||||
Container: *resp.GetBody().GetContainer(),
|
||||
}, nil
|
||||
return container.NewContainerFromV2(resp.GetBody().GetContainer()), nil
|
||||
default:
|
||||
return nil, unsupportedProtocolErr
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue