-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_clusternetwork.go
40 lines (31 loc) · 1.19 KB
/
fake_clusternetwork.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
package testclient
import (
ktestclient "k8s.io/kubernetes/pkg/client/unversioned/testclient"
sdnapi "github.com/openshift/origin/pkg/sdn/api"
)
// FakeClusterNetwork implements ClusterNetworkInterface. 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 FakeClusterNetwork struct {
Fake *Fake
}
func (c *FakeClusterNetwork) Get(name string) (*sdnapi.ClusterNetwork, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootGetAction("clusternetworks", name), &sdnapi.ClusterNetwork{})
if obj == nil {
return nil, err
}
return obj.(*sdnapi.ClusterNetwork), err
}
func (c *FakeClusterNetwork) Create(inObj *sdnapi.ClusterNetwork) (*sdnapi.ClusterNetwork, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootCreateAction("clusternetworks", inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*sdnapi.ClusterNetwork), err
}
func (c *FakeClusterNetwork) Update(inObj *sdnapi.ClusterNetwork) (*sdnapi.ClusterNetwork, error) {
obj, err := c.Fake.Invokes(ktestclient.NewRootUpdateAction("clusternetworks", inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*sdnapi.ClusterNetwork), err
}