Skip to content

Commit

Permalink
up: remove docker machine create suggestion when DOCKER_HOST is wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
mfojtik committed Apr 19, 2018
1 parent 1e65805 commit 1e47b24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 0 additions & 6 deletions pkg/oc/bootstrap/docker/errors/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,11 @@ const (
Please install Docker tools by following instructions at:
https://docs.docker.com/mac/
Once installed, run this command with the --create-machine
argument to create a new Docker machine that will run OpenShift.
`
NoDockerWindowsSolution = `
Please install Docker tools by following instructions at:
https://docs.docker.com/windows/
Once installed, run this command with the --create-machine argument to create a
new Docker machine that will run OpenShift.
`
NoDockerLinuxSolution = `
Ensure that Docker is installed and accessible in your environment.
Expand Down
13 changes: 8 additions & 5 deletions pkg/oc/bootstrap/docker/up.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ func (c *ClusterUpConfig) Complete(cmd *cobra.Command, out io.Writer) error {
c.BaseDir = absHostDir
}

// Check if users are not trying to re-run cluster up on existing configuration
// but with different components enabled.
if !sets.NewString(c.UserEnabledComponents...).Equal(sets.NewString("*")) {
if _, err := os.Stat(filepath.Join(c.BaseDir, "etcd")); err == nil {
return fmt.Errorf("cannot use --enable when the cluster is already initialized, use cluster add instead")
}
}

for _, currComponent := range knownComponents.UnsortedList() {
if isComponentEnabled(currComponent, componentsDisabledByDefault, c.UserEnabledComponents...) {
c.ComponentsToEnable = append(c.ComponentsToEnable, currComponent)
Expand Down Expand Up @@ -399,11 +407,6 @@ func (c *ClusterUpConfig) Validate(errout io.Writer) error {
if c.dockerClient == nil {
return fmt.Errorf("missing dockerClient")
}
if !sets.NewString(c.UserEnabledComponents...).Equal(sets.NewString("*")) {
if _, err := os.Stat(filepath.Join(c.BaseDir, "etcd")); err == nil {
return fmt.Errorf("cannot use --enable when the cluster is already initialized, use cluster add instead")
}
}
cmdutil.WarnAboutCommaSeparation(errout, c.Environment, "--env")
return nil
}
Expand Down

0 comments on commit 1e47b24

Please sign in to comment.