Merge pull request #1531 from brendandburns/auth

Re-add the ability to load certs from the config file.
pull/6/head
Brendan Burns 2014-10-01 17:15:17 -07:00
commit d3816069e6
2 changed files with 12 additions and 0 deletions

View File

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

View File

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