mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #88940 from tianhongw/master
fix golint errors in staging/src/k8s.io/client-go/plugin/pkg/client/a…
This commit is contained in:
commit
5bfe8fe2b9
@ -407,7 +407,6 @@ staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake
|
|||||||
staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake
|
staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake
|
||||||
staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake
|
staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake
|
||||||
staging/src/k8s.io/client-go/metadata/fake
|
staging/src/k8s.io/client-go/metadata/fake
|
||||||
staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc
|
|
||||||
staging/src/k8s.io/client-go/rest
|
staging/src/k8s.io/client-go/rest
|
||||||
staging/src/k8s.io/client-go/rest/fake
|
staging/src/k8s.io/client-go/rest/fake
|
||||||
staging/src/k8s.io/client-go/rest/watch
|
staging/src/k8s.io/client-go/rest/watch
|
||||||
|
@ -35,7 +35,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
cfgIssuerUrl = "idp-issuer-url"
|
cfgIssuerURL = "idp-issuer-url"
|
||||||
cfgClientID = "client-id"
|
cfgClientID = "client-id"
|
||||||
cfgClientSecret = "client-secret"
|
cfgClientSecret = "client-secret"
|
||||||
cfgCertificateAuthority = "idp-certificate-authority"
|
cfgCertificateAuthority = "idp-certificate-authority"
|
||||||
@ -109,9 +109,9 @@ func (c *clientCache) setClient(clusterAddress, issuer, clientID string, client
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newOIDCAuthProvider(clusterAddress string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
|
func newOIDCAuthProvider(clusterAddress string, cfg map[string]string, persister restclient.AuthProviderConfigPersister) (restclient.AuthProvider, error) {
|
||||||
issuer := cfg[cfgIssuerUrl]
|
issuer := cfg[cfgIssuerURL]
|
||||||
if issuer == "" {
|
if issuer == "" {
|
||||||
return nil, fmt.Errorf("Must provide %s", cfgIssuerUrl)
|
return nil, fmt.Errorf("Must provide %s", cfgIssuerURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
clientID := cfg[cfgClientID]
|
clientID := cfg[cfgClientID]
|
||||||
@ -216,7 +216,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) {
|
|||||||
return r.wrapped.RoundTrip(r2)
|
return r.wrapped.RoundTrip(r2)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *roundTripper) WrappedRoundTripper() http.RoundTripper { return t.wrapped }
|
func (r *roundTripper) WrappedRoundTripper() http.RoundTripper { return r.wrapped }
|
||||||
|
|
||||||
func (p *oidcAuthProvider) idToken() (string, error) {
|
func (p *oidcAuthProvider) idToken() (string, error) {
|
||||||
p.mu.Lock()
|
p.mu.Lock()
|
||||||
@ -240,7 +240,7 @@ func (p *oidcAuthProvider) idToken() (string, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine provider's OAuth2 token endpoint.
|
// Determine provider's OAuth2 token endpoint.
|
||||||
tokenURL, err := tokenEndpoint(p.client, p.cfg[cfgIssuerUrl])
|
tokenURL, err := tokenEndpoint(p.client, p.cfg[cfgIssuerURL])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
@ -263,7 +263,7 @@ func (p *oidcAuthProvider) idToken() (string, error) {
|
|||||||
// providers (Okta) don't return this value.
|
// providers (Okta) don't return this value.
|
||||||
//
|
//
|
||||||
// See https://github.com/kubernetes/kubernetes/issues/36847
|
// See https://github.com/kubernetes/kubernetes/issues/36847
|
||||||
return "", fmt.Errorf("token response did not contain an id_token, either the scope \"openid\" wasn't requested upon login, or the provider doesn't support id_tokens as part of the refresh response.")
|
return "", fmt.Errorf("token response did not contain an id_token, either the scope \"openid\" wasn't requested upon login, or the provider doesn't support id_tokens as part of the refresh response")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a new config to persist.
|
// Create a new config to persist.
|
||||||
|
Loading…
Reference in New Issue
Block a user