From 21d5c01fc50cf1fe6ebbf64f3bf543ba8a31a0fd Mon Sep 17 00:00:00 2001 From: Priya Wadhwa Date: Thu, 12 Nov 2020 14:32:23 -0800 Subject: [PATCH] warn that this only works with docker right now --- cmd/minikube/cmd/stop.go | 7 ++++--- pkg/minikube/schedule/schedule.go | 5 +++++ 2 files changed, 9 insertions(+), 3 deletions(-) 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 {