kubernetes components using leader election to leases

Signed-off-by: aimuz <mr.imuz@gmail.com>
This commit is contained in:
aimuz
2022-11-22 11:50:38 +08:00
parent 57eb5d631c
commit 059acc2f5a
3 changed files with 53 additions and 3 deletions

View File

@@ -102,6 +102,12 @@ func (o *GenericControllerManagerConfigurationOptions) Validate(allControllers [
errs := []error{}
errs = append(errs, o.Debugging.Validate()...)
// TODO: This can be removed when ResourceLock is not available
// Lock the ResourceLock using leases
if o.LeaderElection.LeaderElect && o.LeaderElection.ResourceLock != "leases" {
errs = append(errs, fmt.Errorf(`resourceLock value must be "leases"`))
}
allControllersSet := sets.NewString(allControllers...)
for _, controller := range o.Controllers {
if controller == "*" {