frostfs-cli: Add control ir remove-container
#742
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#742
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/cli_remove_container"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
frostfs-cli control ir remove-container
allows delete container directly on ir-node without owner's private key.Closes #733
frostfs-cli: Addto WIP: frostfs-cli: Addcontrol ir remove-container
control ir remove-container
a0c7512f05
toa19d366644
a19d366644
toc0b33697be
WIP: frostfs-cli: Addto frostfs-cli: Addcontrol ir remove-container
control ir remove-container
@ -0,0 +52,4 @@
verifyResponse(cmd, resp.GetSignature(), resp.GetBody())
if len(req.GetBody().GetContainerId()) > 0 {
Maybe just
Operation succeeded
I prefer more specific messages. Therefore, if it is not necessary, then I will leave it as it is.
@ -0,0 +81,4 @@
if len(ownerStr) > 0 {
var owner user.ID
commonCmd.ExitOnErr(cmd, "invalid owner ID: %w", owner.DecodeString(ownerStr))
req.Body.Owner = []byte(ownerStr)
Why is
cid
sent in raw format and owner as[]byte
?Fixed. Missed that user.ID is wrapper of gRPC type OwnerID.
Also fixed some error codes
@ -102,0 +119,4 @@
}
}
if len(req.Body.GetOwner()) > 0 {
I would prohibit using both owner and container here too, what about returning nil from the previous
if
?Fixed: now this condition is checked
@ -102,0 +131,4 @@
}
for _, containerID := range cids {
if err := s.removeContainer(containerID); err != nil {
This doesn't take long because the operation doesn't wait for persist, so me can sent >1 container in a single block?
In this case user facing message in the frostfs-cli is wrong: user containers are not removed, but queried for removal and we need some way to check progress (probably,
frostfs-cli container list
?)Fixed: command description and log messages changed
c0b33697be
to1221eeba82
1221eeba82
to77164dfb56
77164dfb56
to38ade8d3f2
@ -68,3 +68,2 @@
// If TryNotary is provided, calls notary contract.
func (c *Client) Delete(p DeletePrm) error {
if len(p.signature) == 0 {
func (c *Client) Delete(p DeletePrm, isControl bool) error {
Why have not you considered to put the flag
isControl
withinDeletePrm
?DeletePrm
is for this purpose to avoid passing many parameters to the methodFixed. Good point, thx.
@ -0,0 +71,4 @@
if err != nil {
commonCmd.ExitOnErr(cmd, "failed to get cid: ", err)
}
You don't need to check
if err != nil
if you usecommonCmd.ExitOnErr
The same is fair for the check above
Fixed.
38ade8d3f2
to87af6ce4f6
87af6ce4f6
to189dbb01be
frostfs-control ir remove-container
to support/v0.36 branch #746control ir remove-container
#786