createCluster: fix final print after cluster creation on windows (different setting of env vars)

This commit is contained in:
iwilltry42 2020-04-23 14:43:08 +02:00
parent cec907e1f3
commit 091190447c
No known key found for this signature in database
GPG Key ID: 7BA57AD1CFF16110

View File

@ -25,6 +25,7 @@ package create
import (
"fmt"
"os"
"runtime"
"time"
"github.com/spf13/cobra"
@ -73,6 +74,10 @@ func NewCmdCreateCluster() *cobra.Command {
// print information on how to use the cluster with kubectl
log.Infof("Cluster '%s' created successfully. You can now use it like this:", cluster.Name)
if runtime.GOOS == "windows" {
log.Debugf("GOOS is %s", runtime.GOOS)
fmt.Printf("$env:KUBECONFIG=(%s get kubeconfig %s)\n", os.Args[0], cluster.Name)
}
fmt.Printf("export KUBECONFIG=$(%s get kubeconfig %s)\n", os.Args[0], cluster.Name)
fmt.Println("kubectl cluster-info")
},