Skip to content

Commit

Permalink
Update rolling update ig roles flag to be case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
KashifSaadat committed Jun 27, 2018
1 parent af4df08 commit 7b5cb2d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/kops/rollingupdatecluster.go
Expand Up @@ -21,6 +21,7 @@ import (
"io"
"os"
"strconv"
"strings"
"time"

"github.com/golang/glog"
Expand Down Expand Up @@ -181,7 +182,7 @@ func NewCmdRollingUpdateCluster(f *util.Factory, out io.Writer) *cobra.Command {
cmd.Flags().DurationVar(&options.BastionInterval, "bastion-interval", options.BastionInterval, "Time to wait between restarting bastions")
cmd.Flags().BoolVarP(&options.Interactive, "interactive", "i", options.Interactive, "Prompt to continue after each instance is updated")
cmd.Flags().StringSliceVar(&options.InstanceGroups, "instance-group", options.InstanceGroups, "List of instance groups to update (defaults to all if not specified)")
cmd.Flags().StringSliceVar(&options.InstanceGroupRoles, "instance-group-roles", options.InstanceGroupRoles, "If specified, only instance groups of the specified role will be updated")
cmd.Flags().StringSliceVar(&options.InstanceGroupRoles, "instance-group-roles", options.InstanceGroupRoles, "If specified, only instance groups of the specified role will be updated (e.g. Master,Node,Bastion)")

if featureflag.DrainAndValidateRollingUpdate.Enabled() {
cmd.Flags().BoolVar(&options.FailOnDrainError, "fail-on-drain-error", true, "The rolling-update will fail if draining a node fails.")
Expand Down Expand Up @@ -295,7 +296,7 @@ func RunRollingUpdateCluster(f *util.Factory, out io.Writer, options *RollingUpd

for _, ig := range instanceGroups {
for _, role := range options.InstanceGroupRoles {
if ig.Spec.Role == api.InstanceGroupRole(role) {
if ig.Spec.Role == api.InstanceGroupRole(strings.Title(strings.ToLower(role))) {
filtered = append(filtered, ig)
continue
}
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/kops_rolling-update_cluster.md
Expand Up @@ -74,7 +74,7 @@ kops rolling-update cluster [flags]
--force Force rolling update, even if no changes
-h, --help help for cluster
--instance-group strings List of instance groups to update (defaults to all if not specified)
--instance-group-roles strings If specified, only instance groups of the specified role will be updated
--instance-group-roles strings If specified, only instance groups of the specified role will be updated (e.g. Master,Node,Bastion)
-i, --interactive Prompt to continue after each instance is updated
--master-interval duration Time to wait between restarting masters (default 5m0s)
--node-interval duration Time to wait between restarting nodes (default 4m0s)
Expand Down

0 comments on commit 7b5cb2d

Please sign in to comment.