webhook: support exec auth plugin
This allows webhook static kubeconfig to use an exec auth plugin to configure authentication. https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#authenticate-apiservers Kubernetes-commit: 8b45296661de1f12f441736ae44895ac30f320d4
This commit is contained in:
parent
33871ad74f
commit
84cf7582e3
|
@ -196,6 +196,9 @@ func restConfigFromKubeconfig(configAuthInfo *clientcmdapi.AuthInfo) (*rest.Conf
|
|||
config.Username = configAuthInfo.Username
|
||||
config.Password = configAuthInfo.Password
|
||||
}
|
||||
if configAuthInfo.Exec != nil {
|
||||
config.ExecProvider = configAuthInfo.Exec.DeepCopy()
|
||||
}
|
||||
if configAuthInfo.AuthProvider != nil {
|
||||
return nil, fmt.Errorf("auth provider not supported")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue