From 51ff20165efe8b377c657848637f15f3eaeb24d6 Mon Sep 17 00:00:00 2001 From: Renan DelValle Date: Sat, 2 Dec 2017 15:53:45 -0800 Subject: [PATCH] Adding skeleton for the drain command. --- cmd/drain.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 cmd/drain.go diff --git a/cmd/drain.go b/cmd/drain.go new file mode 100644 index 0000000..82fed86 --- /dev/null +++ b/cmd/drain.go @@ -0,0 +1,27 @@ +package cmd + +import ( + "fmt" + + "github.com/spf13/cobra" +) + +func init() { + rootCmd.AddCommand(drainCmd) +} + +var drainCmd = &cobra.Command{ + Use: "drain [space separated host list]", + Short: "Place a list of space separated Mesos Agents into maintenance mode.", + Long: `Adds a Mesos Agent to Aurora's Drain list. Agents in this list + are not allowed to schedule new tasks and any tasks already running on this Agent + are killed and rescheduled in an Agent that is not in maintenance mode. Command + expects a space separated list of hosts to place into maintenance mode.`, + Args: cobra.MinimumNArgs(1), + Run: drain, +} + +func drain(cmd *cobra.Command, args []string) { + + fmt.Print(args) +}