Handle multiple KUBECONFIGs

pull/861/head
dlorenc 2016-11-29 11:09:55 -08:00
parent bc5f3f0489
commit b9d78a675d
1 changed files with 6 additions and 2 deletions

View File

@ -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)