-
Notifications
You must be signed in to change notification settings - Fork 49
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: allow mirror bucket/object/group using name #250
Conversation
x/storage/client/cli/tx.go
Outdated
@@ -756,11 +756,13 @@ $ %s tx delete-policy 3 | |||
|
|||
func CmdMirrorBucket() *cobra.Command { | |||
cmd := &cobra.Command{ | |||
Use: "mirror-bucket [bucket-id]", | |||
Use: "mirror-bucket [bucket-id] [bucket-name]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a bad parameter setting, for example if I provide bucket-id
, I dont need to provide bucket-name
. I can not set the bucket name only for the current implementation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I changed it to use flags for both bucket-id
and bucket-name
.
90fd751
to
a418577
Compare
if msg.Id.GT(sdk.NewUint(0)) { | ||
objectInfo, found = k.Keeper.GetObjectInfoById(ctx, msg.Id) | ||
} else { | ||
objectInfo, found = k.Keeper.GetObjectInfo(ctx, msg.BucketName, msg.ObjectName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit confused. Any checks will added to make sure the ID and name correspond to each other? Or if the name is specified, the id must be zero, Or if the ID is greater than 0, the name must be empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The check had been added to the ValidateBasic
functions.
a418577
to
52ec318
Compare
Description
This pr will allowing mirroring bucket/object/group by using
id
orname
.Rationale
By using
name
, we can package some messages in a single tx, e.g.,CreateBucket
MirrorBucket
in one tx.Example
NA
Changes
Notable changes: