improve solution message
parent
bdf7c196a1
commit
d32b8d81fe
|
@ -156,7 +156,7 @@ func runStart(cmd *cobra.Command, args []string) {
|
||||||
starter, err := provisionWithDriver(cmd, ds, existing)
|
starter, err := provisionWithDriver(cmd, ds, existing)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
maybeExitWithAdvice(err)
|
maybeExitWithAdvice(err)
|
||||||
maybeAdviceNoExit(err)
|
maybeAdviceNoExit(err, viper.GetString("driver"))
|
||||||
if specified {
|
if specified {
|
||||||
// If the user specified a driver, don't fallback to anything else
|
// If the user specified a driver, don't fallback to anything else
|
||||||
exit.WithError("error provisioning host", err)
|
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
|
// maybeAdviceNoExit will provide advice without exiting, so minikube has a chance to try the failover
|
||||||
func maybeAdviceNoExit(err error) {
|
func maybeAdviceNoExit(err error, driver string) {
|
||||||
driver = viper.GetString("driver")
|
|
||||||
if errors.Is(err, oci.ErrExitedAfterCreate) {
|
if errors.Is(err, oci.ErrExitedAfterCreate) {
|
||||||
out.ErrLn("")
|
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.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} work. The following suggestions might help you get passed this issue:")
|
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, `
|
||||||
out.T(out.Empty, "- Restart your {{.driver_name}} service",out.V{"driver_name": driver})
|
- 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" {
|
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})
|
out.T(out.Empty, `
|
||||||
if runtime.GOOS == "darwin" && driver == oci.Docker{
|
- Ensure your {{.driver_name}} daemon has access to enough CPU/memory resources. `, out.V{"driver_name": driver})
|
||||||
out.T(out.Documentation, "https://docs.docker.com/docker-for-mac/#resources")
|
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{
|
if runtime.GOOS == "windows" && driver == oci.Docker {
|
||||||
out.T(out.Documentation, "https://docs.docker.com/docker-for-windows/#resources")
|
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
|
out.T(out.Empty, `
|
||||||
minikube delete
|
- Delete and recreate minikube cluster
|
||||||
minikube start --driver={{.driver_name}}
|
minikube delete
|
||||||
`,out.V{"driver_name": driver})
|
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, `
|
||||||
|
- If the above suggestion is not helpful, you want to consider using --force-systemd flag:
|
||||||
minikube delete
|
minikube delete
|
||||||
minikube start --force-systemd
|
minikube start --force-systemd`, out.V{"driver_name": driver})
|
||||||
`,out.V{"driver_name": driver})
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
maybeAdviceNoExit(err)
|
|
||||||
|
|
Loading…
Reference in New Issue