From c3d2517371b74d44da94300c6b314e09c4849182 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Wed, 1 Oct 2014 17:10:07 -0700 Subject: [PATCH] Re-add the ability to load certs from the config file. --- cmd/kubecfg/kubecfg.go | 9 +++++++++ pkg/kubecfg/kubecfg.go | 3 +++ 2 files changed, 12 insertions(+) diff --git a/cmd/kubecfg/kubecfg.go b/cmd/kubecfg/kubecfg.go index 66a9278da5..0e00ba87b8 100644 --- a/cmd/kubecfg/kubecfg.go +++ b/cmd/kubecfg/kubecfg.go @@ -188,6 +188,15 @@ func main() { } clientConfig.Username = auth.User clientConfig.Password = auth.Password + if auth.CAFile != "" { + clientConfig.CAFile = auth.CAFile + } + if auth.CertFile != "" { + clientConfig.CertFile = auth.CertFile + } + if auth.KeyFile != "" { + clientConfig.KeyFile = auth.KeyFile + } } kubeClient, err := client.New(clientConfig) if err != nil { diff --git a/pkg/kubecfg/kubecfg.go b/pkg/kubecfg/kubecfg.go index 0aae3588ab..cd1ac41565 100644 --- a/pkg/kubecfg/kubecfg.go +++ b/pkg/kubecfg/kubecfg.go @@ -54,6 +54,9 @@ func promptForString(field string, r io.Reader) string { type AuthInfo struct { User string Password string + CAFile string + CertFile string + KeyFile string } // LoadAuthInfo parses an AuthInfo object from a file path. It prompts user and creates file if it doesn't exist.