mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Scheduler should terminate when it looses leader lock
This commit is contained in:
parent
acaac181dc
commit
e2b29cd508
@ -26,7 +26,6 @@ import (
|
||||
goruntime "runtime"
|
||||
|
||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
||||
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
|
||||
"k8s.io/apiserver/pkg/authentication/authenticator"
|
||||
"k8s.io/apiserver/pkg/authorization/authorizer"
|
||||
genericapifilters "k8s.io/apiserver/pkg/endpoints/filters"
|
||||
@ -262,7 +261,7 @@ func Run(cc schedulerserverconfig.CompletedConfig, stopCh <-chan struct{}, regis
|
||||
cc.LeaderElection.Callbacks = leaderelection.LeaderCallbacks{
|
||||
OnStartedLeading: run,
|
||||
OnStoppedLeading: func() {
|
||||
utilruntime.HandleError(fmt.Errorf("lost master"))
|
||||
klog.Fatalf("leaderelection lost")
|
||||
},
|
||||
}
|
||||
leaderElector, err := leaderelection.NewLeaderElector(*cc.LeaderElection)
|
||||
|
Loading…
Reference in New Issue
Block a user