提交 b9d78a67 编写于 作者: D dlorenc

Handle multiple KUBECONFIGs

上级 bc5f3f04
......@@ -19,6 +19,7 @@ package cmd
import (
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"time"
......@@ -159,9 +160,12 @@ func calculateDiskSizeInMB(humanReadableDiskSize string) int {
// If no CurrentContext is set, the given name will be used.
func setupKubeconfig(name, server, certAuth, cliCert, cliKey string) error {
configFile := os.Getenv(constants.KubeconfigEnvVar)
if configFile == "" {
configEnv := os.Getenv(constants.KubeconfigEnvVar)
var configFile string
if configEnv == "" {
configFile = constants.KubeconfigPath
} else {
configFile = filepath.SplitList(configEnv)[0]
}
glog.Infoln("Using kubeconfig: ", configFile)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册