From c38bfac193f17fc140dba368a30e229d6d738385 Mon Sep 17 00:00:00 2001 From: Dongsu Park Date: Tue, 23 Aug 2016 10:05:01 +0200 Subject: [PATCH] fleetctl: support options --no-block, --block-attempts for destroy command Apparently fleetctl destroy command has never supported both options --no-block and --block-attempts, although runDestroyUnit() tries to use the flags. Fix it by defining the options for cmdDestroy. --- fleetctl/destroy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fleetctl/destroy.go b/fleetctl/destroy.go index 1e9bf867d..9ba618e15 100644 --- a/fleetctl/destroy.go +++ b/fleetctl/destroy.go @@ -27,7 +27,7 @@ var cmdDestroy = &cobra.Command{ Short: "Destroy one or more units in the cluster", Long: `Completely remove one or more running or submitted units from the cluster. -Instructs systemd on the host machine to stop the unit, deferring to systemd +Instructs systemd on the host machine to destroy the unit, deferring to systemd completely for any custom stop directives (i.e. ExecStop option in the unit file). @@ -37,6 +37,9 @@ Destroyed units are impossible to start unless re-submitted.`, func init() { cmdFleet.AddCommand(cmdDestroy) + + cmdDestroy.Flags().IntVar(&sharedFlags.BlockAttempts, "block-attempts", 0, "Wait until the units are destroyed, performing up to N attempts before giving up. A value of 0 indicates no limit. Does not apply to global units.") + cmdDestroy.Flags().BoolVar(&sharedFlags.NoBlock, "no-block", false, "Do not wait until the units are destroyed before exiting. Always the case for global units.") } func runDestroyUnit(cCmd *cobra.Command, args []string) (exit int) {