Fixes exited messages when leaderelection lost

This commit is contained in:
Kun Zhang
2022-03-24 17:33:16 +08:00
parent 56f45c5c81
commit 6f8e9aa05d
3 changed files with 9 additions and 5 deletions

View File

@@ -210,7 +210,7 @@ func Run(ctx context.Context, cc *schedulerserverconfig.CompletedConfig, sched *
default:
// We lost the lock.
klog.ErrorS(nil, "Leaderelection lost")
os.Exit(1)
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
}
},
}