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 12:23:44 +02:00
parent d34848086c
commit 1974c12e0f
30 changed files with 47 additions and 34 deletions
@@ -523,6 +523,7 @@ func TestHighNodeUtilization(t *testing.T) {
}
plugin, err := NewHighNodeUtilization(
ctx,
&HighNodeUtilizationArgs{
Thresholds: testCase.thresholds,
EvictionModes: testCase.evictionModes,
@@ -637,7 +638,7 @@ func TestHighNodeUtilizationWithTaints(t *testing.T) {
t.Fatalf("Unable to initialize a framework handle: %v", err)
}
plugin, err := NewHighNodeUtilization(&HighNodeUtilizationArgs{
plugin, err := NewHighNodeUtilization(ctx, &HighNodeUtilizationArgs{
Thresholds: api.ResourceThresholds{
v1.ResourceCPU: 40,
},