From b13839ec7584096ad91a552da81e14fb3441d39d Mon Sep 17 00:00:00 2001 From: tianhongw Date: Sat, 7 Mar 2020 22:35:10 +0800 Subject: [PATCH] fix golint errors in staging/src/k8s.io/client-go/plugin/pkg/client/auth/oidc Kubernetes-commit: 50de627302097bd978191625583302ff420417f3 --- plugin/pkg/client/auth/oidc/oidc.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugin/pkg/client/auth/oidc/oidc.go b/plugin/pkg/client/auth/oidc/oidc.go index 94021201..8bebf229 100644 --- a/plugin/pkg/client/auth/oidc/oidc.go +++ b/plugin/pkg/client/auth/oidc/oidc.go @@ -35,7 +35,7 @@ import ( ) const ( - cfgIssuerUrl = "idp-issuer-url" + cfgIssuerURL = "idp-issuer-url" cfgClientID = "client-id" cfgClientSecret = "client-secret" 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) { - issuer := cfg[cfgIssuerUrl] + issuer := cfg[cfgIssuerURL] if issuer == "" { - return nil, fmt.Errorf("Must provide %s", cfgIssuerUrl) + return nil, fmt.Errorf("Must provide %s", cfgIssuerURL) } clientID := cfg[cfgClientID] @@ -216,7 +216,7 @@ func (r *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { 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) { p.mu.Lock() @@ -240,7 +240,7 @@ func (p *oidcAuthProvider) idToken() (string, error) { } // 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 { return "", err } @@ -263,7 +263,7 @@ func (p *oidcAuthProvider) idToken() (string, error) { // providers (Okta) don't return this value. // // 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.