mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 07:57:35 +00:00
Updated references from k8s.io/{apiserver,apimachinery} to the new k8s.io/component-base repo. Co-authored-by @Klaven
This commit is contained in:
@@ -17,17 +17,16 @@ limitations under the License.
|
||||
package validation
|
||||
|
||||
import (
|
||||
apimachinery "k8s.io/apimachinery/pkg/apis/config/validation"
|
||||
"k8s.io/apimachinery/pkg/util/validation"
|
||||
"k8s.io/apimachinery/pkg/util/validation/field"
|
||||
apiserver "k8s.io/apiserver/pkg/apis/config/validation"
|
||||
componentbasevalidation "k8s.io/component-base/config/validation"
|
||||
"k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||
)
|
||||
|
||||
// ValidateKubeSchedulerConfiguration ensures validation of the KubeSchedulerConfiguration struct
|
||||
func ValidateKubeSchedulerConfiguration(cc *config.KubeSchedulerConfiguration) field.ErrorList {
|
||||
allErrs := field.ErrorList{}
|
||||
allErrs = append(allErrs, apimachinery.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...)
|
||||
allErrs = append(allErrs, componentbasevalidation.ValidateClientConnectionConfiguration(&cc.ClientConnection, field.NewPath("clientConnection"))...)
|
||||
allErrs = append(allErrs, ValidateKubeSchedulerLeaderElectionConfiguration(&cc.LeaderElection, field.NewPath("leaderElection"))...)
|
||||
if len(cc.SchedulerName) == 0 {
|
||||
allErrs = append(allErrs, field.Required(field.NewPath("schedulerName"), ""))
|
||||
@@ -57,7 +56,7 @@ func ValidateKubeSchedulerLeaderElectionConfiguration(cc *config.KubeSchedulerLe
|
||||
if !cc.LeaderElectionConfiguration.LeaderElect {
|
||||
return allErrs
|
||||
}
|
||||
allErrs = append(allErrs, apiserver.ValidateLeaderElectionConfiguration(&cc.LeaderElectionConfiguration, field.NewPath("leaderElectionConfiguration"))...)
|
||||
allErrs = append(allErrs, componentbasevalidation.ValidateLeaderElectionConfiguration(&cc.LeaderElectionConfiguration, field.NewPath("leaderElectionConfiguration"))...)
|
||||
if len(cc.LockObjectNamespace) == 0 {
|
||||
allErrs = append(allErrs, field.Required(fldPath.Child("lockObjectNamespace"), ""))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user