-
Notifications
You must be signed in to change notification settings - Fork 82
Auto generate Volume Name if not specified in Request #876
Conversation
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.
LGTM, only concern is in case of volume name is empty we are logging it in CLI.
@aravindavk is it possible to add a test case for this. |
glustercli/cmd/volume-create.go
Outdated
@@ -45,12 +46,13 @@ var ( | |||
Use: "create <volname> [<brick> [<brick>]...|--size <size>]", |
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.
need to change this Use
create --name=volname [<brick> [<brick>]...|--size <size>]
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.
updated. Thanks
@aravindavk not related to this. Just a question |
That should be fine I guess, it will reflect the user input. |
We are using all of the struct, but we need to unify these structs. Once we decide on API endpoint for smartvol and regular volume create, we can start unifying them |
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 one case is not handled where name is provided but bricks are omitted. Rest of the changes look good.
@@ -133,17 +133,16 @@ func volumeCreateCmdRun(cmd *cobra.Command, args []string) { | |||
return | |||
} | |||
|
|||
if len(args) < 2 { | |||
if len(args) < 1 { |
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.
what happens when name is specified but bricks are omitted?
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.
Converted name as flag(--name=<name>
). args will contain bricks list only.
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.
thanks!
I realized that, I need to update documentation and args upgrade script. Do not merge. I will also add test case as @Madhu-1 suggested |
Updates: #851 Signed-off-by: Aravinda VK <avishwan@redhat.com>
Added tests and updated documentation. Please review |
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.
LGTM
Updates: #851
Signed-off-by: Aravinda VK avishwan@redhat.com