mirror of
https://github.com/kubernetes-sigs/descheduler.git
synced 2026-01-26 05:14:13 +01:00
Turn StrategyParameters.NodeResourceUtilizationThresholds field into a pointer
The field is intended to be omitempty when not set. Without a pointer the strategy
serialized into json string looks like:
```json
strategies:
LowNodeUtilization:
enabled: true
params:
nodeResourceUtilizationThresholds:
numberOfNodes: 1
targetThresholds:
cpu: 50
memory: 50
pods: 20
thresholds:
cpu: 50
memory: 50
pods: 20
RemoveDuplicates:
enabled: true
params:
nodeResourceUtilizationThresholds: {}
RemovePodsViolatingInterPodAntiAffinity:
enabled: true
params:
nodeResourceUtilizationThresholds: {}
RemovePodsViolatingNodeAffinity:
enabled: true
params:
nodeAffinityType:
- requiredDuringSchedulingIgnoredDuringExecution
nodeResourceUtilizationThresholds: {}
RemovePodsViolatingNodeTaints:
enabled: true
params:
nodeResourceUtilizationThresholds: {}
```
It's preferred to have the following json string instead:
```
strategies:
LowNodeUtilization:
enabled: true
params:
nodeResourceUtilizationThresholds:
numberOfNodes: 1
targetThresholds:
cpu: 50
memory: 50
pods: 20
thresholds:
cpu: 50
memory: 50
pods: 20
RemoveDuplicates:
enabled: true
RemovePodsViolatingInterPodAntiAffinity:
enabled: true
RemovePodsViolatingNodeAffinity:
enabled: true
params:
nodeAffinityType:
- requiredDuringSchedulingIgnoredDuringExecution
RemovePodsViolatingNodeTaints:
enabled: true
```
This commit is contained in:
@@ -118,7 +118,7 @@ func startEndToEndForLowNodeUtilization(clientset clientset.Interface, nodeInfor
|
||||
lowNodeUtilizationStrategy := deschedulerapi.DeschedulerStrategy{
|
||||
Enabled: true,
|
||||
Params: deschedulerapi.StrategyParameters{
|
||||
NodeResourceUtilizationThresholds: deschedulerapi.NodeResourceUtilizationThresholds{
|
||||
NodeResourceUtilizationThresholds: &deschedulerapi.NodeResourceUtilizationThresholds{
|
||||
Thresholds: thresholds,
|
||||
TargetThresholds: targetThresholds,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user