Enable --all for get-kubeconfig
This commit is contained in:
parent
81748f9b3a
commit
836201611b
@ -365,14 +365,22 @@ func ListClusters(c *cli.Context) error {
|
|||||||
|
|
||||||
// GetKubeConfig grabs the kubeconfig from the running cluster and prints the path to stdout
|
// GetKubeConfig grabs the kubeconfig from the running cluster and prints the path to stdout
|
||||||
func GetKubeConfig(c *cli.Context) error {
|
func GetKubeConfig(c *cli.Context) error {
|
||||||
cluster := c.String("name")
|
clusters, err := getClusters(c.Bool("all"), c.String("name"))
|
||||||
kubeConfigPath, err := getKubeConfig(cluster)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// output kubeconfig file path to stdout
|
for _, cluster := range clusters {
|
||||||
fmt.Println(kubeConfigPath)
|
kubeConfigPath, err := getKubeConfig(cluster.name)
|
||||||
|
if err != nil {
|
||||||
|
log.Println(err)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
// output kubeconfig file path to stdout
|
||||||
|
fmt.Println(kubeConfigPath)
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user