mirror of
https://github.com/kubernetes/client-go.git
synced 2025-07-19 17:39:56 +00:00
client-go: make exec auth and auth provider mutually exclusive
Kubernetes-commit: d96fd39651a4182ceb016c879a17c6a237c87f53
This commit is contained in:
parent
45b15acf0b
commit
f2a9823316
@ -18,6 +18,7 @@ package rest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/tls"
|
"crypto/tls"
|
||||||
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"k8s.io/client-go/plugin/pkg/client/auth/exec"
|
"k8s.io/client-go/plugin/pkg/client/auth/exec"
|
||||||
@ -83,6 +84,11 @@ func (c *Config) TransportConfig() (*transport.Config, error) {
|
|||||||
},
|
},
|
||||||
Dial: c.Dial,
|
Dial: c.Dial,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.ExecProvider != nil && c.AuthProvider != nil {
|
||||||
|
return nil, errors.New("execProvider and authProvider cannot be used in combination")
|
||||||
|
}
|
||||||
|
|
||||||
if c.ExecProvider != nil {
|
if c.ExecProvider != nil {
|
||||||
provider, err := exec.GetAuthenticator(c.ExecProvider)
|
provider, err := exec.GetAuthenticator(c.ExecProvider)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user