From bb3124c48a4d276ed280175e5825ea9db022d699 Mon Sep 17 00:00:00 2001 From: David McCormick Date: Mon, 24 Sep 2018 17:15:27 +0100 Subject: [PATCH] Remove excessive warnings with x509 certificate auth Suppress common name verify warning log and roll up into returned error remove glog test dependency --- .../k8s.io/apiserver/pkg/authentication/request/x509/BUILD | 1 - .../k8s.io/apiserver/pkg/authentication/request/x509/x509.go | 4 +--- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/BUILD b/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/BUILD index 815cdbbc89e..399197ea136 100644 --- a/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/BUILD +++ b/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/BUILD @@ -36,7 +36,6 @@ go_library( "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/apiserver/pkg/authentication/authenticator:go_default_library", "//staging/src/k8s.io/apiserver/pkg/authentication/user:go_default_library", - "//vendor/github.com/golang/glog:go_default_library", "//vendor/github.com/prometheus/client_golang/prometheus:go_default_library", ], ) diff --git a/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go b/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go index c98d7ff681f..5c4e5a56b00 100644 --- a/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go +++ b/staging/src/k8s.io/apiserver/pkg/authentication/request/x509/x509.go @@ -23,7 +23,6 @@ import ( "net/http" "time" - "github.com/golang/glog" "github.com/prometheus/client_golang/prometheus" utilerrors "k8s.io/apimachinery/pkg/util/errors" @@ -168,8 +167,7 @@ func (a *Verifier) verifySubject(subject pkix.Name) error { if a.allowedCommonNames.Has(subject.CommonName) { return nil } - glog.Warningf("x509: subject with cn=%s is not in the allowed list: %v", subject.CommonName, a.allowedCommonNames.List()) - return fmt.Errorf("x509: subject with cn=%s is not allowed", subject.CommonName) + return fmt.Errorf("x509: subject with cn=%s is not in the allowed list", subject.CommonName) } // DefaultVerifyOptions returns VerifyOptions that use the system root certificates, current time,