mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-29 14:37:00 +00:00
Return authentication webhook error message
This commit is contained in:
parent
6da24b591e
commit
fe549a5a17
@ -19,6 +19,7 @@ package webhook
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
authentication "k8s.io/api/authentication/v1beta1"
|
||||
@ -120,7 +121,11 @@ func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token
|
||||
|
||||
r.Status = result.Status
|
||||
if !r.Status.Authenticated {
|
||||
return nil, false, nil
|
||||
var err error
|
||||
if len(r.Status.Error) != 0 {
|
||||
err = errors.New(r.Status.Error)
|
||||
}
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
var extra map[string][]string
|
||||
|
Loading…
Reference in New Issue
Block a user