-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update docker env during minikube start if VM has already been created #3387
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
|
@@ -93,6 +94,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, "Error detecting OS") | ||
} | ||
if err := provisioner.Provision(*h.HostOptions.SwarmOptions, *h.HostOptions.AuthOptions, *h.HostOptions.EngineOptions); err != nil { | ||
return nil, errors.Wrap(err, "Error running provisioning") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No caps here either. Just "provision" will do fine as additional context. Leave the mention about an error to main.When the error is ultimately handled by the program's main function, it should provide a clear causal chain from the root problem to the overall failures reminiscent of a NASA accident investigation: genesis: crashed: no parachute: G-switch failed: bad relay orientation |
||
} | ||
} | ||
|
||
if h.Driver.DriverName() != "none" { | ||
if err := h.ConfigureAuth(); err != nil { | ||
return nil, &util.RetriableError{Err: errors.Wrap(err, "Error configuring auth on host")} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error messages shouldn't start with capital letters, and it's difficult to determine if the error was actually with OS detection here. How about something like:
errors.Wrap(err, "detecting provisioner")