use klog.Info and klog.Warning when had no format

Kubernetes-commit: 90f4aeeea4cc5f96caa6ed87c67ca7e62d1ba21c
This commit is contained in:
xiongzhongliang 2020-11-14 00:55:06 +08:00 committed by Kubernetes Publisher
parent a588cec107
commit 351f1ab57a
4 changed files with 5 additions and 5 deletions

View File

@ -37,7 +37,7 @@ import (
// is invoked to serve the request. // is invoked to serve the request.
func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences) http.Handler { func WithAuthentication(handler http.Handler, auth authenticator.Request, failed http.Handler, apiAuds authenticator.Audiences) http.Handler {
if auth == nil { if auth == nil {
klog.Warningf("Authentication is disabled") klog.Warning("Authentication is disabled")
return handler return handler
} }
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {

View File

@ -44,7 +44,7 @@ const (
// WithAuthorizationCheck passes all authorized requests on to handler, and returns a forbidden error otherwise. // WithAuthorizationCheck passes all authorized requests on to handler, and returns a forbidden error otherwise.
func WithAuthorization(handler http.Handler, a authorizer.Authorizer, s runtime.NegotiatedSerializer) http.Handler { func WithAuthorization(handler http.Handler, a authorizer.Authorizer, s runtime.NegotiatedSerializer) http.Handler {
if a == nil { if a == nil {
klog.Warningf("Authorization is disabled") klog.Warning("Authorization is disabled")
return handler return handler
} }
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {

View File

@ -334,8 +334,8 @@ func (s *DelegatingAuthenticationOptions) ApplyTo(authenticationInfo *server.Aut
if err != nil { if err != nil {
if s.TolerateInClusterLookupFailure { if s.TolerateInClusterLookupFailure {
klog.Warningf("Error looking up in-cluster authentication configuration: %v", err) klog.Warningf("Error looking up in-cluster authentication configuration: %v", err)
klog.Warningf("Continuing without authentication configuration. This may treat all requests as anonymous.") klog.Warning("Continuing without authentication configuration. This may treat all requests as anonymous.")
klog.Warningf("To require authentication configuration lookup to succeed, set --authentication-tolerate-lookup-failure=false") klog.Warning("To require authentication configuration lookup to succeed, set --authentication-tolerate-lookup-failure=false")
} else { } else {
return fmt.Errorf("unable to load configmap based request-header-client-ca-file: %v", err) return fmt.Errorf("unable to load configmap based request-header-client-ca-file: %v", err)
} }

View File

@ -173,7 +173,7 @@ func (s *DelegatingAuthorizationOptions) toAuthorizer(client kubernetes.Interfac
} }
if client == nil { if client == nil {
klog.Warningf("No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.") klog.Warning("No authorization-kubeconfig provided, so SubjectAccessReview of authorization tokens won't work.")
} else { } else {
cfg := authorizerfactory.DelegatingAuthorizerConfig{ cfg := authorizerfactory.DelegatingAuthorizerConfig{
SubjectAccessReviewClient: client.AuthorizationV1().SubjectAccessReviews(), SubjectAccessReviewClient: client.AuthorizationV1().SubjectAccessReviews(),