cli: fix SDK PrmContainerGet usage for GetContainerPrm #590

Merged
fyrchik merged 2 commits from aarifullin/frostfs-node:fix/sdk_types_usage into master 2023-08-10 11:09:33 +00:00
Member

Signed-off-by: Airat Arifullin a.arifullin@yadro.com

Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
aarifullin added the
frostfs-cli
label 2023-08-10 08:42:07 +00:00
aarifullin changed title from [#XX] cli: fix SDK PrmContainerGet usage for GetContainerPrm to cli: fix SDK PrmContainerGet usage for GetContainerPrm 2023-08-10 08:42:20 +00:00
aarifullin force-pushed fix/sdk_types_usage from c25f7167bc to beef668c4b 2023-08-10 08:45:10 +00:00 Compare
Owner

Could you describe what scenario lead to a problem?

Could you describe what scenario lead to a problem?
Author
Member

Could you describe what scenario lead to a problem?

Since PrmContainerPut uses struct pointers

func (x *GetContainerPrm) SetContainer(id cid.ID) {
	*x.cliPrm.ContainerID = id
}

this method failed and caused the panic

this can be fixed like

func (x *GetContainerPrm) SetContainer(id cid.ID) {
	x.ClientParams.ContainerID = &id
}

but I think it is better to make aws-sdk-like params usage everywhere: not only in sdk but also in node

> Could you describe what scenario lead to a problem? Since [PrmContainerPut](https://git.frostfs.info/TrueCloudLab/frostfs-sdk-go/src/branch/master/client/container_get.go#L24) uses struct pointers ```golang func (x *GetContainerPrm) SetContainer(id cid.ID) { *x.cliPrm.ContainerID = id } ``` this method failed and caused the panic this can be fixed like ```golang func (x *GetContainerPrm) SetContainer(id cid.ID) { x.ClientParams.ContainerID = &id } ``` but I think it is better to make `aws-sdk`-like params usage everywhere: not only in sdk but also in node
aarifullin force-pushed fix/sdk_types_usage from beef668c4b to 47556f9ee5 2023-08-10 09:21:18 +00:00 Compare
acid-ant approved these changes 2023-08-10 10:22:13 +00:00
fyrchik approved these changes 2023-08-10 10:28:13 +00:00
fyrchik merged commit 34b5d90441 into master 2023-08-10 11:09:33 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#590
No description provided.