forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_deployments.go
45 lines (36 loc) · 1.65 KB
/
fake_deployments.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 client
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
deployapi "github.com/openshift/origin/pkg/deploy/api"
)
// FakeDeployments implements BuildInterface. 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 FakeDeployments struct {
Fake *Fake
Namespace string
}
func (c *FakeDeployments) List(label, field labels.Selector) (*deployapi.DeploymentList, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "list-deployment"})
return &deployapi.DeploymentList{}, nil
}
func (c *FakeDeployments) Get(name string) (*deployapi.Deployment, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "get-deployment"})
return &deployapi.Deployment{}, nil
}
func (c *FakeDeployments) Create(deployment *deployapi.Deployment) (*deployapi.Deployment, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "create-deployment"})
return &deployapi.Deployment{}, nil
}
func (c *FakeDeployments) Update(deployment *deployapi.Deployment) (*deployapi.Deployment, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "update-deployment", Value: deployment})
return &deployapi.Deployment{}, nil
}
func (c *FakeDeployments) Delete(name string) error {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "delete-deployment"})
return nil
}
func (c *FakeDeployments) Watch(label, field labels.Selector, resourceVersion string) (watch.Interface, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "watch-deployments"})
return nil, nil
}