Skip to content

Commit

Permalink
command/suspend: if no parameters are passed just run suspend and do …
Browse files Browse the repository at this point in the history
…not schedule suspend task
  • Loading branch information
mmatczuk committed Jan 12, 2022
1 parent 85f7d80 commit a634713
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/command/suspend/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ func (cmd *command) init() {
}

func (cmd *command) run(args []string) error {
// On plain suspend call do not create a task.
if !cmd.Update() && cmd.duration.Value() == 0 {
t := cmd.CreateTask(managerclient.SuspendTask)
if t.Schedule.Cron == "" && t.Schedule.StartDate == nil {
return cmd.client.Suspend(cmd.Context(), cmd.cluster)
}
}

var (
task *managerclient.Task
ok bool
Expand Down

0 comments on commit a634713

Please sign in to comment.