diff --git a/cmd/minikube/cmd/stop.go b/cmd/minikube/cmd/stop.go index a677051b66..2c4d2f4c87 100644 --- a/cmd/minikube/cmd/stop.go +++ b/cmd/minikube/cmd/stop.go @@ -99,12 +99,13 @@ func runStop(cmd *cobra.Command, args []string) { schedule.KillExisting(profilesToStop) if scheduledStopDuration != 0 { - if runtime.GOOS == "windows" { - exit.Message(reason.Usage, "the --schedule flag is currently not supported on windows") - } if err := schedule.Daemonize(profilesToStop, scheduledStopDuration); err != nil { exit.Message(reason.DaemonizeError, "unable to daemonize: {{.err}}", out.V{"err": err.Error()}) } + // if OS is windows, scheduled stop is now being handled within minikube, so return + if runtime.GOOS == "windows" { + return + } klog.Infof("sleeping %s before completing stop...", scheduledStopDuration.String()) time.Sleep(scheduledStopDuration) } diff --git a/pkg/minikube/schedule/schedule.go b/pkg/minikube/schedule/schedule.go index a016cf00bf..f4b2e16ba0 100644 --- a/pkg/minikube/schedule/schedule.go +++ b/pkg/minikube/schedule/schedule.go @@ -17,6 +17,7 @@ limitations under the License. package schedule import ( + "runtime" "time" "github.com/pkg/errors" @@ -40,6 +41,10 @@ func Daemonize(profiles []string, duration time.Duration) error { out.WarningT("scheduled stop is not supported on the none driver, skipping scheduling") continue } + if runtime.GOOS == "windows" && driver.IsVM(cc.Driver) { + out.WarningT("scheduled stop is not yet supported with VM drivers on Windows, skipping scheduling") + continue + } daemonizeProfiles = append(daemonizeProfiles, p) cc.ScheduledStop = scheduledStop if err := config.SaveProfile(p, cc); err != nil {