mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
Separate migration of strategy configuration from the constructing and running the plugins (#999)
* Remove log level from Errors Every error printed via Errors is expected to be important and always printable. * Invoke first Deschedule and then Balance extension points (breaking change) * Separate plugin arg conversion from pluginsMap * Seperate profile population from plugin execution * Convert strategy params into profiles outside the main descheduling loop Strategy params are static and do not change in time. * Bump the internal DeschedulerPolicy to v1alpha2 Drop conversion from v1alpha1 to internal * add tests to v1alpha1 to internal conversion * add tests to strategyParamsToPluginArgs params wiring * in v1alpha1 evictableNamespaces are still Namespaces * add test passing in all params Co-authored-by: Lucas Severo Alves <lseveroa@redhat.com>
This commit is contained in:
@@ -55,14 +55,14 @@ func GetPriorityFromPriorityClass(ctx context.Context, client clientset.Interfac
|
||||
|
||||
// GetPriorityFromStrategyParams gets priority from the given StrategyParameters.
|
||||
// It will return SystemCriticalPriority by default.
|
||||
func GetPriorityFromStrategyParams(ctx context.Context, client clientset.Interface, params *api.StrategyParameters) (priority int32, err error) {
|
||||
if params == nil {
|
||||
func GetPriorityFromStrategyParams(ctx context.Context, client clientset.Interface, priorityThreshold *api.PriorityThreshold) (priority int32, err error) {
|
||||
if priorityThreshold == nil {
|
||||
return SystemCriticalPriority, nil
|
||||
}
|
||||
if params.ThresholdPriority != nil {
|
||||
priority = *params.ThresholdPriority
|
||||
if priorityThreshold.Value != nil {
|
||||
priority = *priorityThreshold.Value
|
||||
} else {
|
||||
priority, err = GetPriorityFromPriorityClass(ctx, client, params.ThresholdPriorityClassName)
|
||||
priority, err = GetPriorityFromPriorityClass(ctx, client, priorityThreshold.Name)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user