@@ -25,6 +25,7 @@ import (
25
25
26
26
authenticationv1 "k8s.io/api/authentication/v1"
27
27
authenticationv1beta1 "k8s.io/api/authentication/v1beta1"
28
+ metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
28
29
"k8s.io/apimachinery/pkg/runtime"
29
30
"k8s.io/apimachinery/pkg/runtime/schema"
30
31
"k8s.io/apiserver/pkg/authentication/authenticator"
@@ -41,7 +42,7 @@ const retryBackoff = 500 * time.Millisecond
41
42
var _ authenticator.Token = (* WebhookTokenAuthenticator )(nil )
42
43
43
44
type tokenReviewer interface {
44
- CreateContext (ctx context.Context , review * authenticationv1.TokenReview ) (* authenticationv1.TokenReview , error )
45
+ Create (ctx context.Context , review * authenticationv1.TokenReview , _ metav1. CreateOptions ) (* authenticationv1.TokenReview , error )
45
46
}
46
47
47
48
type WebhookTokenAuthenticator struct {
@@ -101,7 +102,7 @@ func (w *WebhookTokenAuthenticator) AuthenticateToken(ctx context.Context, token
101
102
auds authenticator.Audiences
102
103
)
103
104
webhook .WithExponentialBackoff (ctx , w .initialBackoff , func () error {
104
- result , err = w .tokenReview .CreateContext (ctx , r )
105
+ result , err = w .tokenReview .Create (ctx , r , metav1. CreateOptions {} )
105
106
return err
106
107
}, webhook .DefaultShouldRetry )
107
108
if err != nil {
@@ -196,7 +197,7 @@ type tokenReviewV1Client struct {
196
197
w * webhook.GenericWebhook
197
198
}
198
199
199
- func (t * tokenReviewV1Client ) CreateContext (ctx context.Context , review * authenticationv1.TokenReview ) (* authenticationv1.TokenReview , error ) {
200
+ func (t * tokenReviewV1Client ) Create (ctx context.Context , review * authenticationv1.TokenReview , _ metav1. CreateOptions ) (* authenticationv1.TokenReview , error ) {
200
201
result := & authenticationv1.TokenReview {}
201
202
err := t .w .RestClient .Post ().Body (review ).Do (ctx ).Into (result )
202
203
return result , err
@@ -206,7 +207,7 @@ type tokenReviewV1beta1Client struct {
206
207
w * webhook.GenericWebhook
207
208
}
208
209
209
- func (t * tokenReviewV1beta1Client ) CreateContext (ctx context.Context , review * authenticationv1.TokenReview ) (* authenticationv1.TokenReview , error ) {
210
+ func (t * tokenReviewV1beta1Client ) Create (ctx context.Context , review * authenticationv1.TokenReview , _ metav1. CreateOptions ) (* authenticationv1.TokenReview , error ) {
210
211
v1beta1Review := & authenticationv1beta1.TokenReview {Spec : v1SpecToV1beta1Spec (& review .Spec )}
211
212
v1beta1Result := & authenticationv1beta1.TokenReview {}
212
213
err := t .w .RestClient .Post ().Body (v1beta1Review ).Do (ctx ).Into (v1beta1Result )
0 commit comments