Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pkg/oc/bootstrap/docker/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,15 @@ func (c *ClusterUpConfig) Complete(f *osclientcmd.Factory, cmd *cobra.Command, o
c.dockerClient = client
taskPrinter.Success()

// Ensure that the OpenShift Docker image is available.
// If not present, pull it.
// We do this here because the image is used in the next step if running Red Hat docker.
taskPrinter.StartTask(fmt.Sprintf("Checking if image %s is available", c.openshiftImage()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to be setting value sin the Options struct. Move it to the Run?

Copy link
Member Author

@derekwaynecarr derekwaynecarr Mar 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my comment "We do this here because the image is used in the next step..." where next step is next line of code ;-)

literally this code block fails on "CanUseNsenterMounter" tries to run the image.

	// Check whether the Docker host has the right binaries to use Kubernetes' nsenter mounter
	// If not, use a shared volume to mount volumes on OpenShift
	if isRedHatDocker, err := c.DockerHelper().IsRedHat(); err == nil && isRedHatDocker {
		taskPrinter.StartTask("Checking type of volume mount")
		c.UseNsenterMount, err = c.HostHelper().CanUseNsenterMounter()
		if err != nil {
			return taskPrinter.ToError(err)
		}
		taskPrinter.Success()
	}

i don't love where the code is right now, i tried to put it next to startKubelet until i saw the above.

if err := c.checkOpenShiftImage(out); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was previously called in Check. What needs it earlier?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed in comment above.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre-existing, but what a horribly named method. A Check that mutates global state on the host?!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i used what existed ;-)

return taskPrinter.ToError(err)
}
taskPrinter.Success()

// Check whether the Docker host has the right binaries to use Kubernetes' nsenter mounter
// If not, use a shared volume to mount volumes on OpenShift
if isRedHatDocker, err := c.DockerHelper().IsRedHat(); err == nil && isRedHatDocker {
Expand Down