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.