Skip to content

Commit d9367d1

Browse files
author
Gabriel Monroy
committed
fix(deisctl): ignore units that dont exist on destroy
1 parent 702e9a7 commit d9367d1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

deisctl/backend/fleet/destroy.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ func (c *FleetClient) Destroy(targets []string) error {
1313
// check if the unit exists
1414
_, err := c.Units(target)
1515
if err != nil {
16+
if strings.Contains(err.Error(), "could not find unit") {
17+
return nil
18+
}
1619
return err
1720
}
1821
component, num, err := splitTarget(target)
@@ -24,7 +27,7 @@ func (c *FleetClient) Destroy(targets []string) error {
2427
} else {
2528
err = c.destroyServiceUnit(component, num)
2629
}
27-
if err != nil {
30+
if err != nil && !strings.Contains(err.Error(), "could not find unit") {
2831
return err
2932
}
3033
}

0 commit comments

Comments
 (0)