Replace with

Kubernetes-commit: 1a598798fca6f15f4e883368666e7d4d3565fcc6
This commit is contained in:
tanjing2020 2021-07-23 10:26:26 +08:00 committed by Kubernetes Publisher
parent 9efd239b45
commit 4e2d5a4ec5
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token
start := time.Now()
result, statusCode, tokenReviewErr = w.tokenReview.Create(ctx, r, metav1.CreateOptions{})
latency := time.Now().Sub(start)
latency := time.Since(start)
if statusCode != 0 {
w.metrics.RecordRequestTotal(ctx, strconv.Itoa(statusCode))

View File

@ -206,7 +206,7 @@ func (w *WebhookAuthorizer) Authorize(ctx context.Context, attr authorizer.Attri
start := time.Now()
result, statusCode, sarErr = w.subjectAccessReview.Create(ctx, r, metav1.CreateOptions{})
latency := time.Now().Sub(start)
latency := time.Since(start)
if statusCode != 0 {
w.metrics.RecordRequestTotal(ctx, strconv.Itoa(statusCode))