More understandable error for scheduler configuration validation

Signed-off-by: kerthcet <kerthcet@gmail.com>
This commit is contained in:
kerthcet 2023-12-19 19:13:30 +08:00
parent 8a9e0d936a
commit 538248df0d

View File

@ -273,11 +273,11 @@ func validateCommonQueueSort(path *field.Path, profiles []config.KubeSchedulerPr
curr = profiles[i].Plugins.QueueSort
}
if !cmp.Equal(canon, curr) {
errs = append(errs, field.Invalid(path.Index(i).Child("plugins", "queueSort"), curr, "has to match for all profiles"))
errs = append(errs, field.Invalid(path.Index(i).Child("plugins", "queueSort"), curr, "queueSort must be the same for all profiles"))
}
for _, cfg := range profiles[i].PluginConfig {
if cfg.Name == queueSortName && !cmp.Equal(queueSortArgs, cfg.Args) {
errs = append(errs, field.Invalid(path.Index(i).Child("pluginConfig", "args"), cfg.Args, "has to match for all profiles"))
errs = append(errs, field.Invalid(path.Index(i).Child("pluginConfig", "args"), cfg.Args, "queueSort must be the same for all profiles"))
}
}
}