未验证 提交 eee22545 编写于 作者: M Medya Ghazizadeh 提交者: GitHub

Merge pull request #10911 from tharun208/fix/minikube_status_for_scheduled_stop

Fix/minikube status for scheduled stop
......@@ -28,7 +28,9 @@ import (
"github.com/VividCortex/godaemon"
"github.com/pkg/errors"
"k8s.io/klog/v2"
"k8s.io/minikube/pkg/minikube/config"
"k8s.io/minikube/pkg/minikube/localpath"
"k8s.io/minikube/pkg/minikube/mustload"
)
// KillExisting kills existing scheduled stops by looking up the PID
......@@ -38,6 +40,11 @@ func KillExisting(profiles []string) {
if err := killPIDForProfile(profile); err != nil {
klog.Errorf("error killng PID for profile %s: %v", profile, err)
}
_, cc := mustload.Partial(profile)
cc.ScheduledStop = nil
if err := config.SaveProfile(profile, cc); err != nil {
klog.Errorf("error saving profile for profile %s: %v", profile, err)
}
}
}
......
......@@ -105,7 +105,10 @@ func TestScheduledStopUnix(t *testing.T) {
// sleep 12 just to be safe
stopMinikube(ctx, t, profile, []string{"--cancel-scheduled"})
time.Sleep(12 * time.Second)
// make sure minikube status is "Running"
ensureMinikubeStatus(ctx, t, profile, "Host", state.Running.String())
// make sure minikube timetoStop is not present
ensureTimeToStopNotPresent(ctx, t, profile)
// schedule another stop, make sure minikube status is "Stopped"
stopMinikube(ctx, t, profile, []string{"--schedule", "5s"})
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册