warn that this only works with docker right now
parent
5411b3b2f2
commit
21d5c01fc5
|
@ -99,12 +99,13 @@ func runStop(cmd *cobra.Command, args []string) {
|
||||||
schedule.KillExisting(profilesToStop)
|
schedule.KillExisting(profilesToStop)
|
||||||
|
|
||||||
if scheduledStopDuration != 0 {
|
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 {
|
if err := schedule.Daemonize(profilesToStop, scheduledStopDuration); err != nil {
|
||||||
exit.Message(reason.DaemonizeError, "unable to daemonize: {{.err}}", out.V{"err": err.Error()})
|
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())
|
klog.Infof("sleeping %s before completing stop...", scheduledStopDuration.String())
|
||||||
time.Sleep(scheduledStopDuration)
|
time.Sleep(scheduledStopDuration)
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
package schedule
|
package schedule
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"runtime"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/pkg/errors"
|
"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")
|
out.WarningT("scheduled stop is not supported on the none driver, skipping scheduling")
|
||||||
continue
|
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)
|
daemonizeProfiles = append(daemonizeProfiles, p)
|
||||||
cc.ScheduledStop = scheduledStop
|
cc.ScheduledStop = scheduledStop
|
||||||
if err := config.SaveProfile(p, cc); err != nil {
|
if err := config.SaveProfile(p, cc); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue