1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

add warning when enabling both dryRun and leaderElection

Signed-off-by: Furkan <furkan.turkal@trendyol.com>
Co-authored-by: Emin <emin.aktas@trendyol.com>
This commit is contained in:
Furkan
2022-06-14 10:58:22 +03:00
parent 5641fa335a
commit fa1f7969d1
3 changed files with 10 additions and 0 deletions

View File

@@ -79,6 +79,10 @@ func Run(ctx context.Context, rs *options.DeschedulerServer) error {
return fmt.Errorf("leaderElection must be used with deschedulingInterval")
}
if rs.LeaderElection.LeaderElect && rs.DryRun {
klog.V(1).InfoS("Warning: DryRun is set to True. You need to disable it to use Leader Election.")
}
if rs.LeaderElection.LeaderElect && !rs.DryRun {
if err := NewLeaderElection(runFn, rsclient, &rs.LeaderElection, ctx); err != nil {
return fmt.Errorf("leaderElection: %w", err)