New package defines .kubernetes_auth format.

Refactored common code to that package.
Subsequent PRs will load and emit these files.
This commit is contained in:
Eric Tune
2014-11-11 15:23:09 -08:00
parent 91d7a19fe3
commit 0727219c83
9 changed files with 228 additions and 63 deletions

View File

@@ -175,7 +175,9 @@ func GetKubeConfig(cmd *cobra.Command) *client.Config {
// command line). Override them with the command line parameters, if
// provided.
authPath := GetFlagString(cmd, "auth-path")
authInfo, err := kubectl.LoadAuthInfo(authPath, os.Stdin)
authInfo, err := kubectl.LoadClientAuthInfoOrPrompt(authPath, os.Stdin)
// TODO: handle the case where the file could not be written but
// we still got a user/pass from prompting.
if err != nil {
glog.Fatalf("Error loading auth: %v", err)
}