add flag to manage $KUBECONFIG files

This commit is contained in:
deads2k
2015-02-03 08:56:06 -05:00
parent 2ac6bbb7eb
commit affa85fab0
3 changed files with 63 additions and 16 deletions

View File

@@ -19,6 +19,7 @@ package config
import (
"fmt"
"io"
"os"
"github.com/ghodss/yaml"
"github.com/spf13/cobra"
@@ -82,7 +83,7 @@ func (o *viewOptions) getStartingConfig() (*clientcmdapi.Config, string, error)
switch {
case o.merge:
loadingRules := clientcmd.NewClientConfigLoadingRules()
loadingRules.EnvVarPath = ""
loadingRules.EnvVarPath = os.Getenv("KUBECONFIG")
loadingRules.CommandLinePath = o.pathOptions.specifiedFile
overrides := &clientcmd.ConfigOverrides{}