-
Notifications
You must be signed in to change notification settings - Fork 299
fleetctl: check for empty input unit strings #1461
Conversation
|
@dongsupark can you put these checks somewhere in one place. these copy-pastes look terrible. |
44272de to
92f287a
Compare
|
@kayrus I updated the branch dongsu/error-empty-units. |
|
@jonboulle lgtm |
|
uh, this helper is way overkill. please just revert to the inline check... |
is no simpler than |
|
@jonboulle is it possible to check arguments inside |
|
Why do you need to check inside init? In the context where you're checking, you've just been passed them. |
92f287a to
a2d16c6
Compare
|
@jonboulle all right. I reverted it to the 1st version. So there's no helper in pkg/args.go. |
|
Thanks! Could you add a test for this? :-) |
|
@jonboulle Sure, I can. |
…ate units This is a preparation patch for the next start test patch that will try to create and start units from a template unit
…emplates Since we create units from a template unit, there is a real wait operation. To avoid that and be able to really test functions, just make template units global by default, later new units will be global and we won't wait forever to reach the targetstate we just assume the Desiredstate.
fleetctl/destroy.go
Outdated
| } | ||
|
|
||
| func runDestroyUnits(args []string) (exit int) { | ||
| // Even if no unit is given by user, it should not exit with error, |
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 don't think the comment is necessary. Please just remove it here and everywhere else.
If no unit name is given for fleetctl commands like destroy, load, start, stop, submit, and unload, then return with exit code 0, printing out a soft warning message to stderr. Fixes: coreos#1443
Check that the return value is 0, when the following commands run without any input unit names: destroy, load, start, stop, and unload.
a2d16c6 to
e613e8c
Compare
|
Updated the tree as @jonboulle suggested. |
|
@dongsupark LGTM, but could you please create a new branch then force push on top of this so semaphore could run again ? |
|
Closed in favor of #1475 |
If no unit name is given for fleetctl commands like destroy, load,
start, stop, submit, and unload, then return with exit code 0,
printing out a soft warning message to stderr.
Fixes: #1443
/cc @kayrus @tixxdz @jonboulle