Validate plugin config for KubeSchedulerConfiguration

Signed-off-by: Dave Chen <dave.chen@arm.com>
This commit is contained in:
Dave Chen
2021-03-25 18:18:21 +08:00
parent a5489431cf
commit c6e65079c7
16 changed files with 218 additions and 96 deletions

View File

@@ -184,7 +184,7 @@ func (o *Options) ApplyTo(c *schedulerappconfig.Config) error {
if err != nil {
return err
}
if err := validation.ValidateKubeSchedulerConfiguration(cfg).ToAggregate(); err != nil {
if err := validation.ValidateKubeSchedulerConfiguration(cfg); err != nil {
return err
}
@@ -234,7 +234,7 @@ func emptySchedulerProfileConfig(profiles []kubeschedulerconfig.KubeSchedulerPro
func (o *Options) Validate() []error {
var errs []error
if err := validation.ValidateKubeSchedulerConfiguration(&o.ComponentConfig).ToAggregate(); err != nil {
if err := validation.ValidateKubeSchedulerConfiguration(&o.ComponentConfig); err != nil {
errs = append(errs, err.Errors()...)
}
errs = append(errs, o.SecureServing.Validate()...)