forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_clusterroles.go
58 lines (45 loc) · 1.89 KB
/
fake_clusterroles.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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package testclient
import (
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/testing/core"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
)
// FakeClusterRoles implements ClusterRoleInterface. 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 FakeClusterRoles struct {
Fake *Fake
}
var clusterRolesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "clusterroles"}
func (c *FakeClusterRoles) Get(name string) (*authorizationapi.ClusterRole, error) {
obj, err := c.Fake.Invokes(core.NewRootGetAction(clusterRolesResource, name), &authorizationapi.ClusterRole{})
if obj == nil {
return nil, err
}
return obj.(*authorizationapi.ClusterRole), err
}
func (c *FakeClusterRoles) List(opts kapi.ListOptions) (*authorizationapi.ClusterRoleList, error) {
obj, err := c.Fake.Invokes(core.NewRootListAction(clusterRolesResource, opts), &authorizationapi.ClusterRoleList{})
if obj == nil {
return nil, err
}
return obj.(*authorizationapi.ClusterRoleList), err
}
func (c *FakeClusterRoles) Create(inObj *authorizationapi.ClusterRole) (*authorizationapi.ClusterRole, error) {
obj, err := c.Fake.Invokes(core.NewRootCreateAction(clusterRolesResource, inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*authorizationapi.ClusterRole), err
}
func (c *FakeClusterRoles) Update(inObj *authorizationapi.ClusterRole) (*authorizationapi.ClusterRole, error) {
obj, err := c.Fake.Invokes(core.NewRootUpdateAction(clusterRolesResource, inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*authorizationapi.ClusterRole), err
}
func (c *FakeClusterRoles) Delete(name string) error {
_, err := c.Fake.Invokes(core.NewRootDeleteAction(clusterRolesResource, name), &authorizationapi.ClusterRole{})
return err
}