提交 bd94872a 编写于 作者: P Priya Wadhwa

add additional steps

上级 ddecfd77
......@@ -40,6 +40,7 @@ import (
"k8s.io/minikube/pkg/minikube/exit"
"k8s.io/minikube/pkg/minikube/machine"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/minikube/out/register"
"k8s.io/minikube/pkg/minikube/storageclass"
"k8s.io/minikube/pkg/util/retry"
)
......@@ -382,6 +383,7 @@ func Start(wg *sync.WaitGroup, cc *config.ClusterConfig, toEnable map[string]boo
var awg sync.WaitGroup
defer func() { // making it show after verifications( not perfect till #7613 is closed)
register.Reg.SetStep(register.EnablingAddons)
out.T(out.AddonEnable, "Enabled addons: {{.addons}}", out.V{"addons": strings.Join(toEnableList, ", ")})
}()
for _, a := range toEnableList {
......
......@@ -39,6 +39,7 @@ import (
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/minikube/out/register"
"k8s.io/minikube/pkg/minikube/proxy"
"k8s.io/minikube/pkg/minikube/registry"
"k8s.io/minikube/pkg/minikube/vmpath"
......@@ -257,9 +258,11 @@ func showHostInfo(cfg config.ClusterConfig) {
return
}
if driver.IsKIC(cfg.Driver) { // TODO:medyagh add free disk space on docker machine
register.Reg.SetStep(register.CreatingContainer)
out.T(out.StartingVM, "Creating {{.driver_name}} {{.machine_type}} (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB) ...", out.V{"driver_name": cfg.Driver, "number_of_cpus": cfg.CPUs, "memory_size": cfg.Memory, "machine_type": machineType})
return
}
register.Reg.SetStep(register.CreatingVM)
out.T(out.StartingVM, "Creating {{.driver_name}} {{.machine_type}} (CPUs={{.number_of_cpus}}, Memory={{.memory_size}}MB, Disk={{.disk_size}}MB) ...", out.V{"driver_name": cfg.Driver, "number_of_cpus": cfg.CPUs, "memory_size": cfg.Memory, "disk_size": cfg.DiskSize, "machine_type": machineType})
}
......
......@@ -17,13 +17,17 @@ limitations under the License.
// Package register contains all the logic to print out `minikube start` in JSON
package register
import "fmt"
import (
"fmt"
)
const (
InitialSetup RegStep = "Initial Minikube Setup"
SelectingDriver RegStep = "Selecting Driver"
DownloadingArtifacts RegStep = "Downloading Artifacts"
StartingNode RegStep = "Starting Node"
CreatingContainer RegStep = "Creating Container"
CreatingVM RegStep = "Creating VM"
PreparingKubernetes RegStep = "Preparing Kubernetes"
VerifyingKubernetes RegStep = "Verifying Kubernetes"
EnablingAddons RegStep = "Enabling Addons"
......@@ -50,6 +54,8 @@ func init() {
SelectingDriver,
DownloadingArtifacts,
StartingNode,
CreatingContainer,
CreatingVM,
PreparingKubernetes,
VerifyingKubernetes,
EnablingAddons,
......@@ -61,7 +67,7 @@ func init() {
// totalSteps returns the total number of steps in the register
func (r *Register) totalSteps() string {
return fmt.Sprintf("%d", len(r.steps))
return fmt.Sprintf("%d", len(r.steps)-1)
}
// currentStep returns the current step we are on
......@@ -71,7 +77,9 @@ func (r *Register) currentStep() string {
return fmt.Sprintf("%d", i)
}
}
return ""
// all steps should be registered so this shouldn't happen
// can't call exit.WithError as it creates an import dependency loopm
panic(fmt.Sprintf("%v is not a registered step", r.current))
}
// SetStep sets the current step
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册