Merge pull request #36755 from deads2k/cli-09-extend-impersonate

Automatic merge from submit-queue (batch tested with PRs 36263, 36755, 37357, 37222, 37524)

add other impersonation fields to transport

Adds the group and extra fields to the impersation options in a rest and transport config.

@kubernetes/sig-auth
This commit is contained in:
Kubernetes Submit Queue
2016-12-02 16:26:45 -08:00
committed by GitHub
21 changed files with 498 additions and 82 deletions

View File

@@ -144,7 +144,7 @@ func (config *DirectClientConfig) ClientConfig() (*restclient.Config, error) {
clientConfig.Host = u.String()
}
if len(configAuthInfo.Impersonate) > 0 {
clientConfig.Impersonate = configAuthInfo.Impersonate
clientConfig.Impersonate = restclient.ImpersonationConfig{UserName: configAuthInfo.Impersonate}
}
// only try to read the auth information if we are secure
@@ -215,7 +215,7 @@ func getUserIdentificationPartialConfig(configAuthInfo clientcmdapi.AuthInfo, fa
mergedConfig.BearerToken = string(tokenBytes)
}
if len(configAuthInfo.Impersonate) > 0 {
mergedConfig.Impersonate = configAuthInfo.Impersonate
mergedConfig.Impersonate = restclient.ImpersonationConfig{UserName: configAuthInfo.Impersonate}
}
if len(configAuthInfo.ClientCertificate) > 0 || len(configAuthInfo.ClientCertificateData) > 0 {
mergedConfig.CertFile = configAuthInfo.ClientCertificate