forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_imagerepositories.go
49 lines (39 loc) · 2.01 KB
/
fake_imagerepositories.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
package client
import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
imageapi "github.com/openshift/origin/pkg/image/api"
)
// FakeImageRepositories implements ImageRepositoryInterface. 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 FakeImageRepositories struct {
Fake *Fake
Namespace string
}
var _ ImageRepositoryInterface = &FakeImageRepositories{}
func (c *FakeImageRepositories) List(label labels.Selector, field fields.Selector) (*imageapi.ImageRepositoryList, error) {
obj, err := c.Fake.Invokes(FakeAction{Action: "list-imagerepositories"}, &imageapi.ImageRepositoryList{})
return obj.(*imageapi.ImageRepositoryList), err
}
func (c *FakeImageRepositories) Get(name string) (*imageapi.ImageRepository, error) {
obj, err := c.Fake.Invokes(FakeAction{Action: "get-imagerepository", Value: name}, &imageapi.ImageRepository{})
return obj.(*imageapi.ImageRepository), err
}
func (c *FakeImageRepositories) Create(repo *imageapi.ImageRepository) (*imageapi.ImageRepository, error) {
obj, err := c.Fake.Invokes(FakeAction{Action: "create-imagerepository"}, &imageapi.ImageRepository{})
return obj.(*imageapi.ImageRepository), err
}
func (c *FakeImageRepositories) Update(repo *imageapi.ImageRepository) (*imageapi.ImageRepository, error) {
obj, err := c.Fake.Invokes(FakeAction{Action: "update-imagerepository"}, &imageapi.ImageRepository{})
return obj.(*imageapi.ImageRepository), err
}
func (c *FakeImageRepositories) Delete(name string) error {
_, err := c.Fake.Invokes(FakeAction{Action: "delete-imagerepository", Value: name}, &imageapi.ImageRepository{})
return err
}
func (c *FakeImageRepositories) Watch(label labels.Selector, field fields.Selector, resourceVersion string) (watch.Interface, error) {
c.Fake.Actions = append(c.Fake.Actions, FakeAction{Action: "watch-imagerepositories"})
return nil, nil
}