mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
e2e tests for RemoveFailedPods strategy
Fix priority class default
This commit is contained in:
@@ -90,7 +90,9 @@ func validateAndParseRemoveFailedPodsParams(
|
||||
params *api.StrategyParameters,
|
||||
) (*validatedFailedPodsStrategyParams, error) {
|
||||
if params == nil {
|
||||
return &validatedFailedPodsStrategyParams{}, nil
|
||||
return &validatedFailedPodsStrategyParams{
|
||||
ValidatedStrategyParams: validation.DefaultValidatedStrategyParams(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
strategyParams, err := validation.ValidateAndParseStrategyParams(ctx, client, params)
|
||||
|
||||
@@ -22,20 +22,22 @@ type ValidatedStrategyParams struct {
|
||||
NodeFit bool
|
||||
}
|
||||
|
||||
func DefaultValidatedStrategyParams() ValidatedStrategyParams {
|
||||
return ValidatedStrategyParams{ThresholdPriority: utils.SystemCriticalPriority}
|
||||
}
|
||||
|
||||
func ValidateAndParseStrategyParams(
|
||||
ctx context.Context,
|
||||
client clientset.Interface,
|
||||
params *api.StrategyParameters,
|
||||
) (*ValidatedStrategyParams, error) {
|
||||
var includedNamespaces, excludedNamespaces sets.String
|
||||
if params == nil {
|
||||
return &ValidatedStrategyParams{
|
||||
IncludedNamespaces: includedNamespaces,
|
||||
ExcludedNamespaces: excludedNamespaces,
|
||||
}, nil
|
||||
defaultValidatedStrategyParams := DefaultValidatedStrategyParams()
|
||||
return &defaultValidatedStrategyParams, nil
|
||||
}
|
||||
|
||||
// At most one of include/exclude can be set
|
||||
var includedNamespaces, excludedNamespaces sets.String
|
||||
if params.Namespaces != nil && len(params.Namespaces.Include) > 0 && len(params.Namespaces.Exclude) > 0 {
|
||||
return nil, fmt.Errorf("only one of Include/Exclude namespaces can be set")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user