Fix cluster list action

Restoring the behaviour of `kops get cluster`, where it lists clusters
even if one is configured in kubeconfig.
This commit is contained in:
Justin SB 2021-07-30 13:53:50 +00:00
parent 8d0b2d3773
commit 0b38591e11
1 changed files with 2 additions and 2 deletions

View File

@ -100,8 +100,8 @@ func NewCmdGetCluster(f *util.Factory, out io.Writer, getOptions *GetOptions) *c
return fmt.Errorf("cannot mix --name for cluster with positional arguments")
}
options.ClusterNames = append(options.ClusterNames, args...)
} else {
options.ClusterNames = append(options.ClusterNames, rootCommand.ClusterName(true))
} else if rootCommand.clusterName != "" {
options.ClusterNames = append(options.ClusterNames, rootCommand.clusterName)
}
return nil