-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Expand file tree
/
Copy pathfake_imagestreamimages.go
More file actions
31 lines (23 loc) · 899 Bytes
/
fake_imagestreamimages.go
File metadata and controls
31 lines (23 loc) · 899 Bytes
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
package testclient
import (
"fmt"
ktestclient "k8s.io/kubernetes/pkg/client/unversioned/testclient"
"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{}
func (c *FakeImageStreamImages) Get(repo, imageID string) (*imageapi.ImageStreamImage, error) {
name := fmt.Sprintf("%s@%s", repo, imageID)
obj, err := c.Fake.Invokes(ktestclient.NewGetAction("imagestreamimages", c.Namespace, name), &imageapi.ImageStreamImage{})
if obj == nil {
return nil, err
}
return obj.(*imageapi.ImageStreamImage), err
}