1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 21:31:18 +01:00

Extend plugin's New with a context.Context

The new context.Context can be later used for passing a contextualized
logger. Or, other initialization steps that require the context.
This commit is contained in:
Jan Chaloupka
2025-05-19 11:58:22 +02:00
parent d34848086c
commit 1974c12e0f
30 changed files with 47 additions and 34 deletions

View File

@@ -1391,7 +1391,7 @@ func TestLowNodeUtilization(t *testing.T) {
metricsUtilization = &MetricsUtilization{Source: api.KubernetesMetrics}
}
plugin, err := NewLowNodeUtilization(&LowNodeUtilizationArgs{
plugin, err := NewLowNodeUtilization(ctx, &LowNodeUtilizationArgs{
Thresholds: tc.thresholds,
TargetThresholds: tc.targetThresholds,
UseDeviationThresholds: tc.useDeviationThresholds,
@@ -1551,7 +1551,7 @@ func TestLowNodeUtilizationWithTaints(t *testing.T) {
t.Fatalf("Unable to initialize a framework handle: %v", err)
}
plugin, err := NewLowNodeUtilization(&LowNodeUtilizationArgs{
plugin, err := NewLowNodeUtilization(ctx, &LowNodeUtilizationArgs{
Thresholds: api.ResourceThresholds{
v1.ResourcePods: 20,
},
@@ -1824,7 +1824,7 @@ func TestLowNodeUtilizationWithPrometheusMetrics(t *testing.T) {
result: tc.samples,
dataType: model.ValVector,
}
plugin, err := NewLowNodeUtilization(tc.args, handle)
plugin, err := NewLowNodeUtilization(ctx, tc.args, handle)
if err != nil {
t.Fatalf("Unable to initialize the plugin: %v", err)
}