Skip to content

Commit

Permalink
Merge pull request #3387 from jeffwubj/fix-3276
Browse files Browse the repository at this point in the history
Update docker env during minikube start if VM has already been created
  • Loading branch information
tstromberg authored Jan 24, 2019
2 parents 1faf11e + bb55059 commit 64640a4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/minikube/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"github.com/docker/machine/libmachine/engine"
"github.com/docker/machine/libmachine/host"
"github.com/docker/machine/libmachine/mcnerror"
"github.com/docker/machine/libmachine/provision"
"github.com/docker/machine/libmachine/ssh"
"github.com/docker/machine/libmachine/state"
"github.com/golang/glog"
Expand Down Expand Up @@ -97,6 +98,18 @@ func StartHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error)
}
}

e := engineOptions(config)
if len(e.Env) > 0 {
h.HostOptions.EngineOptions.Env = e.Env
provisioner, err := provision.DetectProvisioner(h.Driver)
if err != nil {
return nil, errors.Wrap(err, "detecting provisioner")
}
if err := provisioner.Provision(*h.HostOptions.SwarmOptions, *h.HostOptions.AuthOptions, *h.HostOptions.EngineOptions); err != nil {
return nil, errors.Wrap(err, "provision")
}
}

if h.Driver.DriverName() != "none" {
if err := h.ConfigureAuth(); err != nil {
return nil, &util.RetriableError{Err: errors.Wrap(err, "Error configuring auth on host")}
Expand Down

0 comments on commit 64640a4

Please sign in to comment.