forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_subjectaccessreview.go
25 lines (20 loc) · 1010 Bytes
/
fake_subjectaccessreview.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package testclient
import (
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/testing/core"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
)
// FakeClusterSubjectAccessReviews implements the ClusterSubjectAccessReviews interface.
// Meant to be embedded into a struct to get a default implementation.
// This makes faking out just the methods you want to test easier.
type FakeClusterSubjectAccessReviews struct {
Fake *Fake
}
var subjectAccessReviewsResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "subjectaccessreviews"}
func (c *FakeClusterSubjectAccessReviews) Create(inObj *authorizationapi.SubjectAccessReview) (*authorizationapi.SubjectAccessReviewResponse, error) {
obj, err := c.Fake.Invokes(core.NewRootCreateAction(subjectAccessReviewsResource, inObj), &authorizationapi.SubjectAccessReviewResponse{})
if cast, ok := obj.(*authorizationapi.SubjectAccessReviewResponse); ok {
return cast, err
}
return nil, err
}