forked from openshift/origin
/
fake_clusterpolicies.go
45 lines (35 loc) · 1.56 KB
/
fake_clusterpolicies.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
package testclient
import (
kapi "k8s.io/kubernetes/pkg/api"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/testing/core"
"k8s.io/kubernetes/pkg/watch"
authorizationapi "github.com/openshift/origin/pkg/authorization/api"
)
// FakeClusterPolicies implements ClusterPolicyInterface. 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 FakeClusterPolicies struct {
Fake *Fake
}
var clusterPoliciesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "clusterpolicies"}
func (c *FakeClusterPolicies) Get(name string) (*authorizationapi.ClusterPolicy, error) {
obj, err := c.Fake.Invokes(core.NewRootGetAction(clusterPoliciesResource, name), &authorizationapi.ClusterPolicy{})
if obj == nil {
return nil, err
}
return obj.(*authorizationapi.ClusterPolicy), err
}
func (c *FakeClusterPolicies) List(opts kapi.ListOptions) (*authorizationapi.ClusterPolicyList, error) {
obj, err := c.Fake.Invokes(core.NewRootListAction(clusterPoliciesResource, opts), &authorizationapi.ClusterPolicyList{})
if obj == nil {
return nil, err
}
return obj.(*authorizationapi.ClusterPolicyList), err
}
func (c *FakeClusterPolicies) Delete(name string) error {
_, err := c.Fake.Invokes(core.NewRootDeleteAction(clusterPoliciesResource, name), &authorizationapi.ClusterPolicy{})
return err
}
func (c *FakeClusterPolicies) Watch(opts kapi.ListOptions) (watch.Interface, error) {
return c.Fake.InvokesWatch(core.NewRootWatchAction(clusterPoliciesResource, opts))
}