Skip to content

Commit

Permalink
Use the openshift/origin-cli|node images where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
smarterclayton committed Apr 26, 2018
1 parent 1ef2f94 commit 8bfeee4
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 3 additions & 1 deletion pkg/oc/bootstrap/clusterup/kubelet/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const (
type NodeStartConfig struct {
// ContainerBinds is a list of local/path:image/path pairs
ContainerBinds []string
// NodeImage is the docker image for the openshift cli
CLIImage string
// NodeImage is the docker image for openshift start node
NodeImage string

Expand Down Expand Up @@ -49,7 +51,7 @@ func (opt NodeStartConfig) MakeNodeConfig(dockerClient dockerhelper.Interface, b
}
createConfigCmd = append(createConfigCmd, opt.Args...)

containerId, rc, err := imageRunHelper.Image(opt.NodeImage).
containerId, rc, err := imageRunHelper.Image(opt.CLIImage).
Privileged().
HostNetwork().
HostPid().
Expand Down
2 changes: 1 addition & 1 deletion pkg/oc/bootstrap/clusterup/kubelet/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
type KubeletStartFlags struct {
// ContainerBinds is a list of local/path:image/path pairs
ContainerBinds []string
// NodeImage is the docker image for openshift start node
// NodeImage is the docker image for openshift start node and the kubelet
NodeImage string
Environment []string
UseSharedVolume bool
Expand Down
7 changes: 4 additions & 3 deletions pkg/oc/bootstrap/docker/run_self_hosted.go
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,8 @@ func (c *ClusterUpConfig) makeNodeConfig(masterConfigDir string) (string, error)

container := kubelet.NewNodeStartConfig()
container.ContainerBinds = append(container.ContainerBinds, masterConfigDir+":/var/lib/origin/openshift.local.masterconfig:z")
container.NodeImage = c.openshiftImage()
container.CLIImage = c.cliImage()
container.NodeImage = c.nodeImage()
container.Args = []string{
fmt.Sprintf("--certificate-authority=%s", "/var/lib/origin/openshift.local.masterconfig/ca.crt"),
fmt.Sprintf("--dns-bind-address=0.0.0.0:%d", c.DNSPort),
Expand All @@ -393,7 +394,7 @@ func (c *ClusterUpConfig) makeNodeConfig(masterConfigDir string) (string, error)
func (c *ClusterUpConfig) makeKubeletFlags(out io.Writer, nodeConfigDir string) ([]string, error) {
container := kubelet.NewKubeletStartFlags()
container.ContainerBinds = append(container.ContainerBinds, nodeConfigDir+":/var/lib/origin/openshift.local.config/node:z")
container.NodeImage = c.openshiftImage()
container.NodeImage = c.nodeImage()
container.UseSharedVolume = !c.UseNsenterMount

kubeletFlags, err := container.MakeKubeletFlags(c.GetDockerClient(), c.BaseDir)
Expand Down Expand Up @@ -473,7 +474,7 @@ func (c *ClusterUpConfig) startKubelet(out io.Writer, masterConfigDir, nodeConfi
// /sys/devices/virtual/net/vethXXX/brport/hairpin_mode, so make this rw, not ro.
container.ContainerBinds = append(container.ContainerBinds, "/sys/devices/virtual/net:/sys/devices/virtual/net:rw")

container.NodeImage = c.openshiftImage()
container.NodeImage = c.nodeImage()
container.HTTPProxy = c.HTTPProxy
container.HTTPSProxy = c.HTTPSProxy
container.NoProxy = c.NoProxy
Expand Down
8 changes: 8 additions & 0 deletions pkg/oc/bootstrap/docker/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,14 @@ func (c *ClusterUpConfig) openshiftImage() string {
return c.ImageTemplate.ExpandOrDie("control-plane")
}

func (c *ClusterUpConfig) cliImage() string {
return c.ImageTemplate.ExpandOrDie("cli")
}

func (c *ClusterUpConfig) nodeImage() string {
return c.ImageTemplate.ExpandOrDie("node")
}

func (c *ClusterUpConfig) determineAdditionalIPs(ip string) ([]string, error) {
additionalIPs := sets.NewString()
serverIPs, err := c.OpenShiftHelper().OtherIPs(ip)
Expand Down

0 comments on commit 8bfeee4

Please sign in to comment.