From e6c4633232b865eaceefaf74b1f0095bbc536f11 Mon Sep 17 00:00:00 2001 From: yiduyangyi Date: Thu, 23 Jul 2020 19:02:07 +0800 Subject: [PATCH] fix golint failures in pkg/kubeapiserver/options, fix some incorrect replace of receiver name --- pkg/kubeapiserver/options/authentication.go | 10 +++++----- pkg/kubeapiserver/options/authorization.go | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/kubeapiserver/options/authentication.go b/pkg/kubeapiserver/options/authentication.go index b03f46f8076..f01118ff8d2 100644 --- a/pkg/kubeapiserver/options/authentication.go +++ b/pkg/kubeapiserver/options/authentication.go @@ -257,8 +257,8 @@ func (o *BuiltInAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { "The client ID for the OpenID Connect client, must be set if oidc-issuer-url is set.") fs.StringVar(&o.OIDC.CAFile, "oidc-ca-file", o.OIDC.CAFile, ""+ - "If set, the OpenID server'o certificate will be verified by one of the authorities "+ - "in the oidc-ca-file, otherwise the host'o root CA set will be used.") + "If set, the OpenID server's certificate will be verified by one of the authorities "+ + "in the oidc-ca-file, otherwise the host's root CA set will be used.") fs.StringVar(&o.OIDC.UsernameClaim, "oidc-username-claim", "sub", ""+ "The OpenID claim to use as the user name. Note that claims other than the default ('sub') "+ @@ -319,7 +319,7 @@ func (o *BuiltInAuthenticationOptions) AddFlags(fs *pflag.FlagSet) { "Overrides the URI for the JSON Web Key Set in the discovery doc served at "+ "/.well-known/openid-configuration. This flag is useful if the discovery doc"+ "and key set are served to relying parties from a URL other than the "+ - "API server'o external (as auto-detected or overridden with external-hostname). "+ + "API server's external (as auto-detected or overridden with external-hostname). "+ "Only valid if the ServiceAccountIssuerDiscovery feature gate is enabled.") // Deprecated in 1.13 @@ -422,10 +422,10 @@ func (o *BuiltInAuthenticationOptions) ToAuthenticationConfig() (kubeauthenticat if len(o.WebHook.ConfigFile) > 0 && o.WebHook.CacheTTL > 0 { if o.TokenSuccessCacheTTL > 0 && o.WebHook.CacheTTL < o.TokenSuccessCacheTTL { - klog.Warningf("the webhook cache ttl of %o is shorter than the overall cache ttl of %o for successful token authentication attempts.", o.WebHook.CacheTTL, o.TokenSuccessCacheTTL) + klog.Warningf("the webhook cache ttl of %s is shorter than the overall cache ttl of %s for successful token authentication attempts.", o.WebHook.CacheTTL, o.TokenSuccessCacheTTL) } if o.TokenFailureCacheTTL > 0 && o.WebHook.CacheTTL < o.TokenFailureCacheTTL { - klog.Warningf("the webhook cache ttl of %o is shorter than the overall cache ttl of %o for failed token authentication attempts.", o.WebHook.CacheTTL, o.TokenFailureCacheTTL) + klog.Warningf("the webhook cache ttl of %s is shorter than the overall cache ttl of %s for failed token authentication attempts.", o.WebHook.CacheTTL, o.TokenFailureCacheTTL) } } } diff --git a/pkg/kubeapiserver/options/authorization.go b/pkg/kubeapiserver/options/authorization.go index 2cd8e971b75..b21690464f2 100644 --- a/pkg/kubeapiserver/options/authorization.go +++ b/pkg/kubeapiserver/options/authorization.go @@ -67,12 +67,12 @@ func (o *BuiltInAuthorizationOptions) Validate() []error { } if mode == authzmodes.ModeABAC { if o.PolicyFile == "" { - allErrors = append(allErrors, fmt.Errorf("authorization-mode ABAC'o authorization policy file not passed")) + allErrors = append(allErrors, fmt.Errorf("authorization-mode ABAC's authorization policy file not passed")) } } if mode == authzmodes.ModeWebhook { if o.WebhookConfigFile == "" { - allErrors = append(allErrors, fmt.Errorf("authorization-mode Webhook'o authorization config file not passed")) + allErrors = append(allErrors, fmt.Errorf("authorization-mode Webhook's authorization config file not passed")) } } } @@ -103,7 +103,7 @@ func (o *BuiltInAuthorizationOptions) AddFlags(fs *pflag.FlagSet) { fs.StringVar(&o.WebhookConfigFile, "authorization-webhook-config-file", o.WebhookConfigFile, ""+ "File with webhook configuration in kubeconfig format, used with --authorization-mode=Webhook. "+ - "The API server will query the remote service to determine access on the API server'o secure port.") + "The API server will query the remote service to determine access on the API server's secure port.") fs.StringVar(&o.WebhookVersion, "authorization-webhook-version", o.WebhookVersion, ""+ "The API version of the authorization.k8s.io SubjectAccessReview to send to and expect from the webhook.")