We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 06f903f + 8f14e8a commit 99f9a44Copy full SHA for 99f9a44
1 file changed
client/destroy.go
@@ -10,13 +10,18 @@ import (
10
// Destroy units for a given target
11
func (c *FleetClient) Destroy(target string) (err error) {
12
// check if the unit exists
13
- if _, err := c.Units(target); err != nil {
+ units, err := c.Units(target)
14
+ if err != nil {
15
return err
16
}
17
component, num, err := splitTarget(target)
18
if err != nil {
19
return
20
21
+ // if no number is specified, destroy ALL THE UNITS!
22
+ if num == 0 {
23
+ num = len(units)
24
+ }
25
if strings.HasSuffix(component, "-data") {
26
err = c.destroyDataUnit(component)
27
} else {
0 commit comments