Changing timeouts to Duration types for giving the user an easier time setting high amoutns of time. Added support for sla-drain count and percentage policies. Coordination policy is to be implemented. Bumped up version number and fixed eimplicit recon calling the wrong API function.

This commit is contained in:
Renan DelValle 2018-11-20 20:11:21 -08:00
parent 2de607464f
commit ef76abd73c
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
5 changed files with 84 additions and 35 deletions

View file

@ -4,6 +4,7 @@ import (
"fmt"
"github.com/paypal/gorealis/gen-go/apache/aurora"
"github.com/spf13/cobra"
"time"
log "github.com/sirupsen/logrus"
)
@ -13,8 +14,8 @@ func init() {
// Stop subcommands
stopCmd.AddCommand(stopMaintCmd)
stopMaintCmd.Flags().IntVar(&monitorInterval,"interval", 5, "Interval at which to poll scheduler.")
stopMaintCmd.Flags().IntVar(&monitorTimeout,"timeout", 50, "Time after which the monitor will stop polling and throw an error.")
stopMaintCmd.Flags().DurationVar(&monitorInterval,"interval", time.Second * 5, "Interval at which to poll scheduler.")
stopMaintCmd.Flags().DurationVar(&monitorTimeout,"timeout", time.Minute * 1, "Time after which the monitor will stop polling and throw an error.")
// Stop update
@ -58,8 +59,8 @@ func endMaintenance(cmd *cobra.Command, args []string) {
hostResult, err := monitor.HostMaintenance(
args,
[]aurora.MaintenanceMode{aurora.MaintenanceMode_NONE},
monitorInterval,
monitorTimeout)
int(monitorInterval.Seconds()),
int(monitorTimeout.Seconds()))
maintenanceMonitorPrint(hostResult,[]aurora.MaintenanceMode{aurora.MaintenanceMode_NONE})