Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit b445699

Browse files
committed
fleetctl: print error message when units were not found in registry
1 parent 8e1dd44 commit b445699

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

fleetctl/destroy.go

+5
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ func runDestroyUnits(args []string) (exit int) {
4646
return 1
4747
}
4848

49+
if len(units) == 0 {
50+
stderr("Units not found in registry")
51+
return 0
52+
}
53+
4954
for _, v := range units {
5055
err := cAPI.DestroyUnit(v.Name)
5156
if err != nil {

fleetctl/stop.go

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ func runStopUnit(args []string) (exit int) {
6363
return 1
6464
}
6565

66+
if len(units) == 0 {
67+
stderr("Units not found in registry")
68+
return 0
69+
}
70+
6671
stopping := make([]string, 0)
6772
for _, u := range units {
6873
if !suToGlobal(u) {

fleetctl/unload.go

+5
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ func runUnloadUnit(args []string) (exit int) {
4747
return 1
4848
}
4949

50+
if len(units) == 0 {
51+
stderr("Units not found in registry")
52+
return 0
53+
}
54+
5055
wait := make([]string, 0)
5156
for _, s := range units {
5257
if !suToGlobal(s) {

0 commit comments

Comments
 (0)