Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]tools-v2: add bs recover volume #2918

Closed

Conversation

CrystalAnalyst
Copy link
Contributor

@CrystalAnalyst CrystalAnalyst commented Nov 20, 2023

What problem does this PR solve?

Issue Number: #2588

Problem Summary: Add a feature that can recover the specified volume from the RecycleBin.

What is changed and how it works?

What's Changed: add recover directory, and inside of it is a volume sub-directory, and two files: recover.go, file.go.

How it Works: recover.go act as an entry, while file.go call the Rpc function to execute the actual recover action.

Side effects(Breaking backward compatibility? Performance regression?):

Check List

  • [yes] Relevant documentation/comments is changed or added
  • [yes] I acknowledge that all my contributions will be made under the project's license

@baytan0720 baytan0720 changed the title Add bs recover volume [feat]tools-v2: add bs recover volume Nov 22, 2023
Copy link
Member

@baytan0720 baytan0720 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the README.md about the new command.
You should post the sample output of the command in description of pr.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This command is a middle command. You can add sub command in middle command. You can refer to tools-v2/pkg/cli/command/curvebs/update/update.go.

"github.com/opencurve/curve/tools-v2/proto/proto/nameserver2"
)

type RecoverCertainFileRpc struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Named the same as RPC

config.AddRpcRetryTimesFlag(recoverCommand.Cmd)
config.AddBsMdsFlagOption(recoverCommand.Cmd)
config.AddBsPathRequiredFlag(recoverCommand.Cmd)
config.AddBsUserOptionFlag(recoverCommand.Cmd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be required

config.AddBsMdsFlagOption(recoverCommand.Cmd)
config.AddBsPathRequiredFlag(recoverCommand.Cmd)
config.AddBsUserOptionFlag(recoverCommand.Cmd)
config.AddBsPasswordOptionFlag(recoverCommand.Cmd)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flag fileid should be added

@CrystalAnalyst
Copy link
Contributor Author

okay, thanks a lot for your advice, I'll fix it in the next few days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants