forked from openshift/origin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default_imagestreams.go
65 lines (52 loc) · 1.68 KB
/
default_imagestreams.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package default_imagestreams
import (
"github.com/openshift/origin/pkg/oc/clusteradd/componentinstall"
"github.com/openshift/origin/pkg/oc/clusterup/docker/dockerhelper"
"github.com/openshift/origin/pkg/oc/clusterup/manifests"
)
const (
rhelLocation = "examples/image-streams/image-streams-rhel7.json"
centosLocation = "examples/image-streams/image-streams-centos7.json"
)
type RHELImageStreamsComponentOptions struct {
InstallContext componentinstall.Context
}
func (c *RHELImageStreamsComponentOptions) Name() string {
return "rhel-imagestreams"
}
func (c *RHELImageStreamsComponentOptions) Install(dockerClient dockerhelper.Interface) error {
secretComponent := DockerConfigSecret{
Name: "imagestreamsecret",
Namespace: "openshift",
}
err := secretComponent.MakeReady(
c.InstallContext.ClientImage(),
c.InstallContext.BaseDir()).Install(dockerClient)
if err != nil {
return err
}
component := componentinstall.List{
Name: c.Name(),
Namespace: "openshift",
List: manifests.MustAsset(rhelLocation),
}
return component.MakeReady(
c.InstallContext.ClientImage(),
c.InstallContext.BaseDir()).Install(dockerClient)
}
type CentosImageStreamsComponentOptions struct {
InstallContext componentinstall.Context
}
func (c *CentosImageStreamsComponentOptions) Name() string {
return "centos-imagestreams"
}
func (c *CentosImageStreamsComponentOptions) Install(dockerClient dockerhelper.Interface) error {
component := componentinstall.List{
Name: c.Name(),
Namespace: "openshift",
List: manifests.MustAsset(centosLocation),
}
return component.MakeReady(
c.InstallContext.ClientImage(),
c.InstallContext.BaseDir()).Install(dockerClient)
}