mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-02 11:02:16 +00:00
Remove wrapper around base LeaderElectionConfiguration
Signed-off-by: Aldo Culquicondor <acondor@google.com>
This commit is contained in:
@@ -35,7 +35,7 @@ import (
|
||||
func ValidateKubeSchedulerConfiguration(cc *config.KubeSchedulerConfiguration) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
allErrs = append(allErrs, componentbasevalidation.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...)
|
||||
allErrs = append(allErrs, validateKubeSchedulerLeaderElectionConfiguration(field.NewPath("leaderElection"), &cc.LeaderElection)...)
|
||||
allErrs = append(allErrs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.LeaderElection, field.NewPath("leaderElection"))...)
|
||||
|
||||
profilesPath := field.NewPath("profiles")
|
||||
if len(cc.Profiles) == 0 {
|
||||
@@ -103,15 +103,6 @@ func validateCommonQueueSort(path *field.Path, profiles []config.KubeSchedulerPr
|
||||
return allErrs
|
||||
}
|
||||
|
||||
func validateKubeSchedulerLeaderElectionConfiguration(fldPath *field.Path, cc *config.KubeSchedulerLeaderElectionConfiguration) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
if !cc.LeaderElectionConfiguration.LeaderElect {
|
||||
return allErrs
|
||||
}
|
||||
allErrs = append(allErrs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.LeaderElectionConfiguration, fldPath)...)
|
||||
return allErrs
|
||||
}
|
||||
|
||||
// ValidatePolicy checks for errors in the Config
|
||||
// It does not return early so that it can find as many errors as possible
|
||||
func ValidatePolicy(policy config.Policy) error {
|
||||
|
||||
Reference in New Issue
Block a user