improve solution message

pull/8501/head
Medya Gh 2020-06-17 14:26:31 -07:00
parent bdf7c196a1
commit d32b8d81fe
1 changed files with 24 additions and 22 deletions

View File

@ -156,7 +156,7 @@ func runStart(cmd *cobra.Command, args []string) {
starter, err := provisionWithDriver(cmd, ds, existing)
if err != nil {
maybeExitWithAdvice(err)
maybeAdviceNoExit(err)
maybeAdviceNoExit(err, viper.GetString("driver"))
if specified {
// If the user specified a driver, don't fallback to anything else
exit.WithError("error provisioning host", err)
@ -1069,33 +1069,35 @@ func maybeExitWithAdvice(err error) {
}
// maybeAdviceNoExit will provide advice without exiting, so minikube has a chance to try the failover
func maybeAdviceNoExit(err error) {
driver = viper.GetString("driver")
func maybeAdviceNoExit(err error, driver string) {
if errors.Is(err, oci.ErrExitedAfterCreate) {
out.ErrLn("")
out.ErrT(out.Conflict, "Unfortunately Container exited after it was created, This could be due to not enough resourced available to {{.driver_name}}", out.V{"driver_name": viper.GetString("driver")})
out.T(out.Tip, "If you are still interested to make {{.driver_name} work. The following suggestions might help you get passed this issue:")
out.T(out.Empty, "- Prune unused {{.driver_name}} images, volumes and abandoned containers.",out.V{"driver_name": driver})
out.T(out.Empty, "- Restart your {{.driver_name}} service",out.V{"driver_name": driver})
out.ErrT(out.Conflict, "Unfortunately {{.driver_name}} container exited after it was created, with an unclear root cause.", out.V{"driver_name": driver})
out.T(out.Tip, "If you are still interested to make {{.driver_name}} driver work. The following suggestions might help you get passed this issue:", out.V{"driver_name": driver})
out.T(out.Empty, `
- Prune unused {{.driver_name}} images, volumes and abandoned containers.`, out.V{"driver_name": driver})
out.T(out.Empty, `
- Restart your {{.driver_name}} service`, out.V{"driver_name": driver})
if runtime.GOOS != "linux" {
out.T(out.Empty, "- ensure your {{.driver_name}} daemon has access to enough CPU/memory resources. ",out.V{"driver_name": driver})
if runtime.GOOS == "darwin" && driver == oci.Docker{
out.T(out.Documentation, "https://docs.docker.com/docker-for-mac/#resources")
out.T(out.Empty, `
- Ensure your {{.driver_name}} daemon has access to enough CPU/memory resources. `, out.V{"driver_name": driver})
if runtime.GOOS == "darwin" && driver == oci.Docker {
out.T(out.Empty, `
- Docs https://docs.docker.com/docker-for-mac/#resources`, out.V{"driver_name": driver})
}
if runtime.GOOS == "windows" && driver == oci.Docker{
out.T(out.Documentation, "https://docs.docker.com/docker-for-windows/#resources")
if runtime.GOOS == "windows" && driver == oci.Docker {
out.T(out.Empty, `
- Docs https://docs.docker.com/docker-for-windows/#resources`, out.V{"driver_name": driver})
}
}
out.T(out.Empty, `- Delete and recreate minikube cluster
minikube delete
minikube start --driver={{.driver_name}}
`,out.V{"driver_name": driver})
out.T(out.Empty, `- If the above suggestion is not helpful, you want want to consider using --force-systemd flag:
out.T(out.Empty, `
- Delete and recreate minikube cluster
minikube delete
minikube start --driver={{.driver_name}}`, out.V{"driver_name": driver})
out.T(out.Empty, `
- If the above suggestion is not helpful, you want to consider using --force-systemd flag:
minikube delete
minikube start --force-systemd
`,out.V{"driver_name": driver})
minikube start --force-systemd`, out.V{"driver_name": driver})
}
}
maybeAdviceNoExit(err)