forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fake_imagestreamimages.go
34 lines (25 loc) · 1.01 KB
/
fake_imagestreamimages.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
package testclient
import (
"fmt"
"k8s.io/kubernetes/pkg/api/unversioned"
"k8s.io/kubernetes/pkg/client/testing/core"
"github.com/openshift/origin/pkg/client"
imageapi "github.com/openshift/origin/pkg/image/api"
)
// FakeImageStreamImages implements ImageStreamImageInterface. 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 FakeImageStreamImages struct {
Fake *Fake
Namespace string
}
var _ client.ImageStreamImageInterface = &FakeImageStreamImages{}
var imageStreamImagesResource = unversioned.GroupVersionResource{Group: "", Version: "", Resource: "imagestreamimages"}
func (c *FakeImageStreamImages) Get(repo, imageID string) (*imageapi.ImageStreamImage, error) {
name := fmt.Sprintf("%s@%s", repo, imageID)
obj, err := c.Fake.Invokes(core.NewGetAction(imageStreamImagesResource, c.Namespace, name), &imageapi.ImageStreamImage{})
if obj == nil {
return nil, err
}
return obj.(*imageapi.ImageStreamImage), err
}