-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implement deployments create #221
base: master
Are you sure you want to change the base?
Conversation
cc2949c
to
065665e
Compare
Merging these commits will result in the following changelog entries: Changelogsmender-cli (master)New changes in mender-cli since master: Features
|
f41204e
to
be04eb4
Compare
Added a new command to create deployments. Changelog: title Ticket: none Signed-off-by: Lars Rustand <[email protected]>
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 @rustand2!
I didn't do a detailed review now, I focused on the high level design. I think it looks alright, but I have requested some changes to improve the command line interface.
if len(args) > 1 { | ||
deploymentName = args[0] | ||
} | ||
|
||
artifactID := "" | ||
if len(args) > 2 { | ||
artifactID = args[1] | ||
} | ||
|
||
deviceList := "" | ||
if len(args) >= 3 { | ||
deviceList = args[2] |
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 having mandatory ordered arguments, with no flags, is not good style, and difficult to change or adapt later. There should be --deployment-name <NAME>
and -n <NAME>
type flags for all of these I think. Take a look at how the other commands are adding arguments.
) | ||
|
||
var deploymentCreateCmd = &cobra.Command{ | ||
Use: "create [flags] DEPLOYMENT_NAME ARTIFACT_NAME DEVICE_LIST", |
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.
This should be documented better, especially device list. Like where it can be found, and whether the list is comma separated or not. I know this comes from the API, but people don't typically look there.
Any news on this @rustand2? Is there something we can help with putting this forward? |
Add a command to create new deployments from mender-cli. I'm sorry if this is rather rough, but I've never used go before. Currently the only deployment command I implemented was
create
, and there is limited handling of wrong arguments. Currently the device list needs to be passed as a raw json list by the user which is probably not an acceptable way to do it. I would appreciate any help to make this better from someone more proficient in go.