Skip to content

Commit

Permalink
fleetctl:destroy: on destroy check if the unit does exist or not
Browse files Browse the repository at this point in the history
Do not error out directly if Destroy command fails, check first if the
unit does really exist if no then ignore the destroy error and continue.

Follow-up fix for: coreos#1383
  • Loading branch information
Djalal Harouni committed Feb 17, 2016
1 parent 9d976d6 commit 35c7d43
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions fleetctl/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ func runDestroyUnits(args []string) (exit int) {
for _, v := range units {
err := cAPI.DestroyUnit(v.Name)
if err != nil {
// If unit does not exist do not error out
u, _ := cAPI.Unit(v.Name)
if u == nil {
continue
}
stderr("Error destroying units: %v", err)
exit = 1
continue
Expand Down

0 comments on commit 35c7d43

Please sign in to comment.