Skip to content

Commit 3b92430

Browse files
committed
to squash: a few minor refactoring
1 parent 535df13 commit 3b92430

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/cvo/metrics.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ func createHttpServer(ctx context.Context, client *authenticationclientsetv1.Aut
142142
return server
143143
}
144144

145-
type TokenReviewInterface interface {
145+
type tokenReviewInterface interface {
146146
Create(ctx context.Context, tokenReview *authenticationv1.TokenReview, opts metav1.CreateOptions) (*authenticationv1.TokenReview, error)
147147
}
148148

149149
type authHandler struct {
150150
downstream http.Handler
151151
ctx context.Context
152-
client TokenReviewInterface
152+
client tokenReviewInterface
153153
}
154154

155155
func (a *authHandler) authorize(token string) (bool, error) {
@@ -163,9 +163,9 @@ func (a *authHandler) authorize(token string) (bool, error) {
163163
return false, fmt.Errorf("failed to check token: %w", err)
164164
}
165165
if !result.Status.Authenticated {
166-
klog.V(2).Info("The token cannot be authenticated.")
166+
klog.V(4).Info("The token cannot be authenticated.")
167167
} else if user := result.Status.User.Username; user != "system:serviceaccount:openshift-monitoring:prometheus-k8s" {
168-
klog.V(2).Infof("Access the metrics from he unexpected user %s is denied.", user)
168+
klog.V(4).Infof("Access the metrics from he unexpected user %s is denied.", user)
169169
}
170170
return result.Status.Authenticated && result.Status.User.Username == "system:serviceaccount:openshift-monitoring:prometheus-k8s", nil
171171
}

0 commit comments

Comments
 (0)