mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 22:46:12 +00:00
Re-add the ability to load certs from the config file.
This commit is contained in:
parent
19fac35349
commit
c3d2517371
@ -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 {
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user