forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imagestreamimages.go
36 lines (30 loc) · 1.08 KB
/
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
35
36
package client
import (
"github.com/openshift/origin/pkg/image/api"
)
// ImageStreamImagesNamespacer has methods to work with ImageStreamImage resources in a namespace
type ImageStreamImagesNamespacer interface {
ImageStreamImages(namespace string) ImageStreamImageInterface
}
// ImageStreamImageInterface exposes methods on ImageStreamImage resources.
type ImageStreamImageInterface interface {
Get(name, id string) (*api.ImageStreamImage, error)
}
// imageStreamImages implements ImageStreamImagesNamespacer interface
type imageStreamImages struct {
r *Client
ns string
}
// newImageStreamImages returns an imageStreamImages
func newImageStreamImages(c *Client, namespace string) *imageStreamImages {
return &imageStreamImages{
r: c,
ns: namespace,
}
}
// Get finds the specified image by name of an image repository and id.
func (c *imageStreamImages) Get(name, id string) (result *api.ImageStreamImage, err error) {
result = &api.ImageStreamImage{}
err = c.r.Get().Namespace(c.ns).Resource("imageStreamImages").Name(api.MakeImageStreamImageName(name, id)).Do().Into(result)
return
}