-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_imagestreamtags.go
41 lines (32 loc) · 1.35 KB
/
fake_imagestreamtags.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
package testclient
import (
ktestclient "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"github.com/openshift/origin/pkg/client"
imageapi "github.com/openshift/origin/pkg/image/api"
)
// FakeImageStreamTags implements ImageStreamTagInterface. 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 FakeImageStreamTags struct {
Fake *Fake
Namespace string
}
var _ client.ImageStreamTagInterface = &FakeImageStreamTags{}
func (c *FakeImageStreamTags) Get(name, tag string) (*imageapi.ImageStreamTag, error) {
obj, err := c.Fake.Invokes(ktestclient.NewGetAction("imagestreamtags", c.Namespace, imageapi.JoinImageStreamTag(name, tag)), &imageapi.ImageStreamTag{})
if obj == nil {
return nil, err
}
return obj.(*imageapi.ImageStreamTag), err
}
func (c *FakeImageStreamTags) Update(inObj *imageapi.ImageStreamTag) (*imageapi.ImageStreamTag, error) {
obj, err := c.Fake.Invokes(ktestclient.NewUpdateAction("imagestreamtags", c.Namespace, inObj), inObj)
if obj == nil {
return nil, err
}
return obj.(*imageapi.ImageStreamTag), err
}
func (c *FakeImageStreamTags) Delete(name, tag string) error {
_, err := c.Fake.Invokes(ktestclient.NewDeleteAction("imagestreamtags", c.Namespace, imageapi.JoinImageStreamTag(name, tag)), &imageapi.ImageStreamTag{})
return err
}