From cff1efff194be65ad2fd5babb360128be45e89ed Mon Sep 17 00:00:00 2001 From: Justin Santa Barbara Date: Tue, 13 Sep 2016 13:36:09 -0400 Subject: [PATCH] Support positional args in upgrade cluster In particular, the cluster name --- cmd/kops/upgrade_cluster.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/kops/upgrade_cluster.go b/cmd/kops/upgrade_cluster.go index 3aeee4143ac9b..5bfb799e49b8f 100644 --- a/cmd/kops/upgrade_cluster.go +++ b/cmd/kops/upgrade_cluster.go @@ -21,7 +21,7 @@ func init() { Short: "Upgrade cluster", Long: `Upgrades a k8s cluster.`, Run: func(cmd *cobra.Command, args []string) { - err := upgradeCluster.Run() + err := upgradeCluster.Run(args) if err != nil { exitWithError(err) } @@ -42,7 +42,12 @@ type upgradeAction struct { apply func() } -func (c *UpgradeClusterCmd) Run() error { +func (c *UpgradeClusterCmd) Run(args []string) error { + err := rootCommand.ProcessArgs(args) + if err != nil { + return err + } + clusterRegistry, cluster, err := rootCommand.Cluster() if err != nil { return err