mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-28 14:41:10 +01:00
StrategyParameters: Add new param ThresholdPriority and ThresholdPriorityClassName
This commit is contained in:
@@ -52,8 +52,8 @@ type Namespaces struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Besides Namespaces only one of its members may be specified
|
// Besides Namespaces only one of its members may be specified
|
||||||
// TODO(jchaloup): move Namespaces to individual strategies once the policy
|
// TODO(jchaloup): move Namespaces ThresholdPriority and ThresholdPriorityClassName to individual strategies
|
||||||
// version is bumped to v1alpha2
|
// once the policy version is bumped to v1alpha2
|
||||||
type StrategyParameters struct {
|
type StrategyParameters struct {
|
||||||
NodeResourceUtilizationThresholds *NodeResourceUtilizationThresholds
|
NodeResourceUtilizationThresholds *NodeResourceUtilizationThresholds
|
||||||
NodeAffinityType []string
|
NodeAffinityType []string
|
||||||
@@ -61,6 +61,8 @@ type StrategyParameters struct {
|
|||||||
MaxPodLifeTimeSeconds *uint
|
MaxPodLifeTimeSeconds *uint
|
||||||
RemoveDuplicates *RemoveDuplicates
|
RemoveDuplicates *RemoveDuplicates
|
||||||
Namespaces Namespaces
|
Namespaces Namespaces
|
||||||
|
ThresholdPriority *int32
|
||||||
|
ThresholdPriorityClassName string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Percentage float64
|
type Percentage float64
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ type Namespaces struct {
|
|||||||
Exclude []string `json:"exclude"`
|
Exclude []string `json:"exclude"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Besides Namespaces only one of its members may be specified
|
// Besides Namespaces ThresholdPriority and ThresholdPriorityClassName only one of its members may be specified
|
||||||
type StrategyParameters struct {
|
type StrategyParameters struct {
|
||||||
NodeResourceUtilizationThresholds *NodeResourceUtilizationThresholds `json:"nodeResourceUtilizationThresholds,omitempty"`
|
NodeResourceUtilizationThresholds *NodeResourceUtilizationThresholds `json:"nodeResourceUtilizationThresholds,omitempty"`
|
||||||
NodeAffinityType []string `json:"nodeAffinityType,omitempty"`
|
NodeAffinityType []string `json:"nodeAffinityType,omitempty"`
|
||||||
@@ -59,6 +59,8 @@ type StrategyParameters struct {
|
|||||||
MaxPodLifeTimeSeconds *uint `json:"maxPodLifeTimeSeconds,omitempty"`
|
MaxPodLifeTimeSeconds *uint `json:"maxPodLifeTimeSeconds,omitempty"`
|
||||||
RemoveDuplicates *RemoveDuplicates `json:"removeDuplicates,omitempty"`
|
RemoveDuplicates *RemoveDuplicates `json:"removeDuplicates,omitempty"`
|
||||||
Namespaces Namespaces `json:"namespaces"`
|
Namespaces Namespaces `json:"namespaces"`
|
||||||
|
ThresholdPriority *int32 `json:"thresholdPriority"`
|
||||||
|
ThresholdPriorityClassName string `json:"thresholdPriorityClassName"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Percentage float64
|
type Percentage float64
|
||||||
|
|||||||
@@ -249,6 +249,8 @@ func autoConvert_v1alpha1_StrategyParameters_To_api_StrategyParameters(in *Strat
|
|||||||
if err := Convert_v1alpha1_Namespaces_To_api_Namespaces(&in.Namespaces, &out.Namespaces, s); err != nil {
|
if err := Convert_v1alpha1_Namespaces_To_api_Namespaces(&in.Namespaces, &out.Namespaces, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
out.ThresholdPriority = (*int32)(unsafe.Pointer(in.ThresholdPriority))
|
||||||
|
out.ThresholdPriorityClassName = in.ThresholdPriorityClassName
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,6 +268,8 @@ func autoConvert_api_StrategyParameters_To_v1alpha1_StrategyParameters(in *api.S
|
|||||||
if err := Convert_api_Namespaces_To_v1alpha1_Namespaces(&in.Namespaces, &out.Namespaces, s); err != nil {
|
if err := Convert_api_Namespaces_To_v1alpha1_Namespaces(&in.Namespaces, &out.Namespaces, s); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
out.ThresholdPriority = (*int32)(unsafe.Pointer(in.ThresholdPriority))
|
||||||
|
out.ThresholdPriorityClassName = in.ThresholdPriorityClassName
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,11 @@ func (in *StrategyParameters) DeepCopyInto(out *StrategyParameters) {
|
|||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
in.Namespaces.DeepCopyInto(&out.Namespaces)
|
in.Namespaces.DeepCopyInto(&out.Namespaces)
|
||||||
|
if in.ThresholdPriority != nil {
|
||||||
|
in, out := &in.ThresholdPriority, &out.ThresholdPriority
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -243,6 +243,11 @@ func (in *StrategyParameters) DeepCopyInto(out *StrategyParameters) {
|
|||||||
(*in).DeepCopyInto(*out)
|
(*in).DeepCopyInto(*out)
|
||||||
}
|
}
|
||||||
in.Namespaces.DeepCopyInto(&out.Namespaces)
|
in.Namespaces.DeepCopyInto(&out.Namespaces)
|
||||||
|
if in.ThresholdPriority != nil {
|
||||||
|
in, out := &in.ThresholdPriority, &out.ThresholdPriority
|
||||||
|
*out = new(int32)
|
||||||
|
**out = **in
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user