mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 03:11:40 +00:00
Fixes exited messages when leaderelection lost
This commit is contained in:
parent
56f45c5c81
commit
6f8e9aa05d
@ -277,7 +277,8 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
|
|||||||
run(ctx, startSATokenController, initializersFunc)
|
run(ctx, startSATokenController, initializersFunc)
|
||||||
},
|
},
|
||||||
OnStoppedLeading: func() {
|
OnStoppedLeading: func() {
|
||||||
klog.Fatalf("leaderelection lost")
|
klog.ErrorS(nil, "leaderelection lost")
|
||||||
|
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -300,7 +301,8 @@ func Run(c *config.CompletedConfig, stopCh <-chan struct{}) error {
|
|||||||
run(ctx, nil, createInitializersFunc(leaderMigrator.FilterFunc, leadermigration.ControllerMigrated))
|
run(ctx, nil, createInitializersFunc(leaderMigrator.FilterFunc, leadermigration.ControllerMigrated))
|
||||||
},
|
},
|
||||||
OnStoppedLeading: func() {
|
OnStoppedLeading: func() {
|
||||||
klog.Fatalf("migration leaderelection lost")
|
klog.ErrorS(nil, "migration leaderelection lost")
|
||||||
|
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -210,7 +210,7 @@ func Run(ctx context.Context, cc *schedulerserverconfig.CompletedConfig, sched *
|
|||||||
default:
|
default:
|
||||||
// We lost the lock.
|
// We lost the lock.
|
||||||
klog.ErrorS(nil, "Leaderelection lost")
|
klog.ErrorS(nil, "Leaderelection lost")
|
||||||
os.Exit(1)
|
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,8 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, cloud cloudprovider.Interface
|
|||||||
run(ctx, initializers)
|
run(ctx, initializers)
|
||||||
},
|
},
|
||||||
OnStoppedLeading: func() {
|
OnStoppedLeading: func() {
|
||||||
klog.Fatalf("leaderelection lost")
|
klog.ErrorS(nil, "leaderelection lost")
|
||||||
|
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -253,7 +254,8 @@ func Run(c *cloudcontrollerconfig.CompletedConfig, cloud cloudprovider.Interface
|
|||||||
run(ctx, filterInitializers(controllerInitializers, leaderMigrator.FilterFunc, leadermigration.ControllerMigrated))
|
run(ctx, filterInitializers(controllerInitializers, leaderMigrator.FilterFunc, leadermigration.ControllerMigrated))
|
||||||
},
|
},
|
||||||
OnStoppedLeading: func() {
|
OnStoppedLeading: func() {
|
||||||
klog.Fatalf("migration leaderelection lost")
|
klog.ErrorS(nil, "migration leaderelection lost")
|
||||||
|
klog.FlushAndExit(klog.ExitFlushTimeout, 1)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user