forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfake_clusterresourcequota.go
59 lines (47 loc) · 2.09 KB
/
fake_clusterresourcequota.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
59
package testclient
import (
kapi "k8s.io/kubernetes/pkg/api"
ktestclient "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"k8s.io/kubernetes/pkg/watch"
quotaapi "github.com/openshift/origin/pkg/quota/api"
)
// FakeClusterResourceQuotas implements ClusterResourceQuotaInterface. 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 FakeClusterResourceQuotas struct {
Fake *Fake
}
func (c *FakeClusterResourceQuotas) Get(name string) (*quotaapi.ClusterResourceQuota, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootGetAction("clusterresourcequotas", name), "aapi.ClusterResourceQuota{})
if obj == nil {
return nil, err
}
return obj.(*quotaapi.ClusterResourceQuota), err
}
func (c *FakeClusterResourceQuotas) List(opts kapi.ListOptions) (*quotaapi.ClusterResourceQuotaList, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootListAction("clusterresourcequotas", opts), "aapi.ClusterResourceQuotaList{})
if obj == nil {
return nil, err
}
return obj.(*quotaapi.ClusterResourceQuotaList), err
}
func (c *FakeClusterResourceQuotas) Create(inObj *quotaapi.ClusterResourceQuota) (*quotaapi.ClusterResourceQuota, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootCreateAction("clusterresourcequotas", inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*quotaapi.ClusterResourceQuota), err
}
func (c *FakeClusterResourceQuotas) Update(inObj *quotaapi.ClusterResourceQuota) (*quotaapi.ClusterResourceQuota, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootUpdateAction("clusterresourcequotas", inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*quotaapi.ClusterResourceQuota), err
}
func (c *FakeClusterResourceQuotas) Delete(name string) error {
_, err := c.Fake.Invokes(ktestclient.NewRootDeleteAction("clusterresourcequotas", name), "aapi.ClusterResourceQuota{})
return err
}
func (c *FakeClusterResourceQuotas) Watch(opts kapi.ListOptions) (watch.Interface, error) {
return c.Fake.InvokesWatch(ktestclient.NewRootWatchAction("clusterresourcequotas", opts))
}