-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expand file tree
/
Copy pathfake_subjectaccessreview.go
More file actions
25 lines (20 loc) · 1016 Bytes
/
fake_subjectaccessreview.go
File metadata and controls
25 lines (20 loc) · 1016 Bytes
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/apimachinery/pkg/runtime/schema"
clientgotesting "k8s.io/client-go/testing"
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 = schema.GroupVersionResource{Group: "", Version: "", Resource: "subjectaccessreviews"}
func (c *FakeClusterSubjectAccessReviews) Create(inObj *authorizationapi.SubjectAccessReview) (*authorizationapi.SubjectAccessReviewResponse, error) {
obj, err := c.Fake.Invokes(clientgotesting.NewRootCreateAction(subjectAccessReviewsResource, inObj), &authorizationapi.SubjectAccessReviewResponse{})
if cast, ok := obj.(*authorizationapi.SubjectAccessReviewResponse); ok {
return cast, err
}
return nil, err
}