skip monitoring create/kill jobs (#13)
Added flag -m and --monitor that can be set in order to monitor a job creation or a job kill. By default monitor is set to true.
This commit is contained in:
parent
82fe22e013
commit
5efbbce6c7
3 changed files with 17 additions and 12 deletions
|
@ -30,6 +30,7 @@ func init() {
|
|||
killJobCmd.Flags().StringVarP(env, "environment", "e", "", "Aurora Environment")
|
||||
killJobCmd.Flags().StringVarP(role, "role", "r", "", "Aurora Role")
|
||||
killJobCmd.Flags().StringVarP(name, "name", "n", "", "Aurora Name")
|
||||
killJobCmd.Flags().BoolVarP(&monitor, "monitor", "m", false, "monitor the result after sending the command")
|
||||
killJobCmd.MarkFlagRequired("environment")
|
||||
killJobCmd.MarkFlagRequired("role")
|
||||
killJobCmd.MarkFlagRequired("name")
|
||||
|
@ -57,8 +58,9 @@ func killJob(cmd *cobra.Command, args []string) {
|
|||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
if ok, err := client.MonitorInstances(job.JobKey(), 0, 5, 50); !ok || err != nil {
|
||||
log.Fatalln("Unable to kill all instances of job")
|
||||
if monitor {
|
||||
if ok, err := client.MonitorInstances(job.JobKey(), 0, 5, 50); !ok || err != nil {
|
||||
log.Fatalln("Unable to kill all instances of job")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue