From 889ffb04d03e49cdbb481b86ea233d0aa3143db6 Mon Sep 17 00:00:00 2001 From: Wilson Husin Date: Thu, 15 Oct 2020 11:06:24 -0700 Subject: [PATCH] Fix golint failures in client-go/transport Signed-off-by: Wilson Husin --- hack/.golint_failures | 1 - staging/src/k8s.io/client-go/transport/config.go | 2 +- staging/src/k8s.io/client-go/transport/round_trippers.go | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hack/.golint_failures b/hack/.golint_failures index 6506c72ac37..71cfcf3cc5c 100644 --- a/hack/.golint_failures +++ b/hack/.golint_failures @@ -399,7 +399,6 @@ staging/src/k8s.io/client-go/tools/leaderelection staging/src/k8s.io/client-go/tools/leaderelection/resourcelock staging/src/k8s.io/client-go/tools/record staging/src/k8s.io/client-go/tools/reference -staging/src/k8s.io/client-go/transport staging/src/k8s.io/client-go/util/exec staging/src/k8s.io/client-go/util/flowcontrol staging/src/k8s.io/client-go/util/jsonpath diff --git a/staging/src/k8s.io/client-go/transport/config.go b/staging/src/k8s.io/client-go/transport/config.go index 926cc53ece0..259eaaceb9e 100644 --- a/staging/src/k8s.io/client-go/transport/config.go +++ b/staging/src/k8s.io/client-go/transport/config.go @@ -108,7 +108,7 @@ func (c *Config) HasCertAuth() bool { return (len(c.TLS.CertData) != 0 || len(c.TLS.CertFile) != 0) && (len(c.TLS.KeyData) != 0 || len(c.TLS.KeyFile) != 0) } -// HasCertCallbacks returns whether the configuration has certificate callback or not. +// HasCertCallback returns whether the configuration has certificate callback or not. func (c *Config) HasCertCallback() bool { return c.TLS.GetCert != nil } diff --git a/staging/src/k8s.io/client-go/transport/round_trippers.go b/staging/src/k8s.io/client-go/transport/round_trippers.go index f4cfadbd3da..fab97dca802 100644 --- a/staging/src/k8s.io/client-go/transport/round_trippers.go +++ b/staging/src/k8s.io/client-go/transport/round_trippers.go @@ -146,6 +146,7 @@ type userAgentRoundTripper struct { rt http.RoundTripper } +// NewUserAgentRoundTripper will add User-Agent header to a request unless it has already been set. func NewUserAgentRoundTripper(agent string, rt http.RoundTripper) http.RoundTripper { return &userAgentRoundTripper{agent, rt} } @@ -260,7 +261,7 @@ func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTr return &bearerAuthRoundTripper{bearer, nil, rt} } -// NewBearerAuthRoundTripper adds the provided bearer token to a request +// NewBearerAuthWithRefreshRoundTripper adds the provided bearer token to a request // unless the authorization header has already been set. // If tokenFile is non-empty, it is periodically read, // and the last successfully read content is used as the bearer token.