Skip to content

Commit 3714bbd

Browse files
authored
Merge pull request #3659 from tstromberg/console
Clearer output when re-using VM's so that users know what they are waiting on
2 parents 4608a13 + 3454c83 commit 3714bbd

File tree

3 files changed

+29
-24
lines changed

3 files changed

+29
-24
lines changed

cmd/minikube/cmd/start.go

-6
Original file line numberDiff line numberDiff line change
@@ -329,12 +329,6 @@ func startHost(api libmachine.API, mc cfg.MachineConfig) (*host.Host, bool) {
329329
if mc.VMDriver == constants.DriverNone {
330330
console.OutStyle("starting-none", "Configuring local host environment ...")
331331
prepareNone()
332-
} else {
333-
if exists {
334-
console.OutStyle("waiting", "Spinning up existing VM for %q ...", cfg.GetMachineName())
335-
} else {
336-
console.OutStyle("starting-vm", "Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...", mc.VMDriver, mc.CPUs, mc.Memory, mc.DiskSize)
337-
}
338332
}
339333

340334
var host *host.Host

pkg/minikube/cluster/cluster.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,10 @@ func StartHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error)
9696
return nil, errors.Wrap(err, "Error getting state for host")
9797
}
9898

99-
if s != state.Running {
99+
if s == state.Running {
100+
console.OutStyle("running", "Re-using the currently running %s VM for %q ...", h.Driver.DriverName(), cfg.GetMachineName())
101+
} else {
102+
console.OutStyle("restarting", "Restarting existing %s VM for %q ...", h.Driver.DriverName(), cfg.GetMachineName())
100103
if err := h.Driver.Start(); err != nil {
101104
return nil, errors.Wrap(err, "start")
102105
}
@@ -106,6 +109,11 @@ func StartHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error)
106109
}
107110

108111
e := engineOptions(config)
112+
glog.Infof("engine options: %+v", e)
113+
114+
// Slightly counter-intuitive, but this is what DetectProvisioner & ConfigureAuth block on.
115+
console.OutStyle("waiting", "Waiting for SSH access ...")
116+
109117
if len(e.Env) > 0 {
110118
h.HostOptions.EngineOptions.Env = e.Env
111119
provisioner, err := provision.DetectProvisioner(h.Driver)
@@ -264,6 +272,7 @@ func createHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error
264272
return nil, err
265273
}
266274

275+
console.OutStyle("starting-vm", "Creating %s VM (CPUs=%d, Memory=%dMB, Disk=%dMB) ...", config.VMDriver, config.CPUs, config.Memory, config.DiskSize)
267276
def, err := registry.Driver(config.VMDriver)
268277
if err != nil {
269278
if err == registry.ErrDriverNotFound {

pkg/minikube/console/style.go

+19-17
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,25 @@ type style struct {
3333
// styles is a map of style name to style struct
3434
// For consistency, ensure that emojis added render with the same width across platforms.
3535
var styles = map[string]style{
36-
"happy": {Prefix: "😄 "},
37-
"success": {Prefix: "✅ "},
38-
"failure": {Prefix: "❌ "},
39-
"conflict": {Prefix: "💥 "},
40-
"fatal": {Prefix: "💣 "},
41-
"notice": {Prefix: "📌 "},
42-
"ready": {Prefix: "🏄 "},
43-
"restarting": {Prefix: "🔄 "},
44-
"stopping": {Prefix: "✋ "},
45-
"stopped": {Prefix: "🛑 "},
46-
"warning": {Prefix: "⚠️ "},
47-
"waiting": {Prefix: "⌛ "},
48-
"usage": {Prefix: "💡 "},
49-
"launch": {Prefix: "🚀 "},
50-
"thumbs-up": {Prefix: "👍 "},
51-
"option": {Prefix: " ▪ "}, // Indented bullet
52-
"crushed": {Prefix: "💔 "},
36+
"happy": {Prefix: "😄 "},
37+
"success": {Prefix: "✅ "},
38+
"failure": {Prefix: "❌ "},
39+
"conflict": {Prefix: "💥 "},
40+
"fatal": {Prefix: "💣 "},
41+
"notice": {Prefix: "📌 "},
42+
"ready": {Prefix: "🏄 "},
43+
"restarting": {Prefix: "🔄 "},
44+
"running": {Prefix: "🏃 "},
45+
"provisioning": {Prefix: "🌱 "},
46+
"stopping": {Prefix: "✋ "},
47+
"stopped": {Prefix: "🛑 "},
48+
"warning": {Prefix: "⚠️ "},
49+
"waiting": {Prefix: "⌛ "},
50+
"usage": {Prefix: "💡 "},
51+
"launch": {Prefix: "🚀 "},
52+
"thumbs-up": {Prefix: "👍 "},
53+
"option": {Prefix: " ▪ "}, // Indented bullet
54+
"crushed": {Prefix: "💔 "},
5355

5456
// Specialized purpose styles
5557
"iso-download": {Prefix: "💿 "},

0 commit comments

Comments
 (0)