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

Commit

Permalink
fleetctl: support options --no-block, --block-attempts for destroy co…
Browse files Browse the repository at this point in the history
…mmand

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.
  • Loading branch information
Dongsu Park committed Aug 23, 2016
1 parent 53ba925 commit c38bfac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fleetctl/destroy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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) {
Expand Down

0 comments on commit c38bfac

Please sign in to comment.