forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imagestreammappings.go
34 lines (28 loc) · 1.06 KB
/
imagestreammappings.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 client
import (
imageapi "github.com/openshift/origin/pkg/image/api"
)
// ImageStreamMappingsNamespacer has methods to work with ImageStreamMapping resources in a namespace
type ImageStreamMappingsNamespacer interface {
ImageStreamMappings(namespace string) ImageStreamMappingInterface
}
// ImageStreamMappingInterface exposes methods on ImageStreamMapping resources.
type ImageStreamMappingInterface interface {
Create(mapping *imageapi.ImageStreamMapping) error
}
// imageStreamMappings implements ImageStreamMappingsNamespacer interface
type imageStreamMappings struct {
r *Client
ns string
}
// newImageStreamMappings returns an imageStreamMappings
func newImageStreamMappings(c *Client, namespace string) *imageStreamMappings {
return &imageStreamMappings{
r: c,
ns: namespace,
}
}
// Create creates a new imagerepository mapping on the server. Returns error if one occurs.
func (c *imageStreamMappings) Create(mapping *imageapi.ImageStreamMapping) error {
return c.r.Post().Namespace(c.ns).Resource("imageStreamMappings").Body(mapping).Do().Error()
}