Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 71ebf9c

Browse files
committed
Update the fake token review interface to include CreateContext
Signed-off-by: JoshVanL <[email protected]>
1 parent 7ad75aa commit 71ebf9c

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/proxy/tokenreview/fake/tokenreview.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,14 @@
22
package fake
33

44
import (
5+
"context"
6+
57
authv1 "k8s.io/api/authentication/v1"
8+
clientauthv1 "k8s.io/client-go/kubernetes/typed/authentication/v1"
69
)
710

11+
var _ clientauthv1.TokenReviewInterface = &FakeReviewer{}
12+
813
type FakeReviewer struct {
914
CreateFn func(*authv1.TokenReview) (*authv1.TokenReview, error)
1015
}
@@ -21,6 +26,10 @@ func (f *FakeReviewer) Create(req *authv1.TokenReview) (*authv1.TokenReview, err
2126
return f.CreateFn(req)
2227
}
2328

29+
func (f *FakeReviewer) CreateContext(ctx context.Context, req *authv1.TokenReview) (*authv1.TokenReview, error) {
30+
return f.CreateFn(req)
31+
}
32+
2433
func (f *FakeReviewer) WithCreate(req *authv1.TokenReview, err error) *FakeReviewer {
2534
f.CreateFn = func(*authv1.TokenReview) (*authv1.TokenReview, error) {
2635
return req, err

0 commit comments

Comments
 (0)