From 108c133ce02493a92304033d3a964a09265544ff Mon Sep 17 00:00:00 2001 From: Bartosz Date: Thu, 5 Mar 2026 10:56:59 +0000 Subject: [PATCH] Replace map in PodGroupAssignments with a list of interface --- staging/src/k8s.io/kube-scheduler/framework/types.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/staging/src/k8s.io/kube-scheduler/framework/types.go b/staging/src/k8s.io/kube-scheduler/framework/types.go index a4501bdded2..f1dee0a1b49 100644 --- a/staging/src/k8s.io/kube-scheduler/framework/types.go +++ b/staging/src/k8s.io/kube-scheduler/framework/types.go @@ -664,12 +664,20 @@ type Placement struct { Nodes []NodeInfo } +// ProposedAssignment associates pod of a pod group with a proposed node assignment, determined in pod group scheduling cycle. +type ProposedAssignment interface { + // GetPod returns the pod that has the proposed node assignment. + GetPod() *v1.Pod + // GetNodeName returns the name of the proposed node for the pod. + GetNodeName() string +} + // PodGroupAssignments holds the temporary assignments of pods in a pod group to nodes for a placement. // Can be used in the pod group scheduling cycle to determine the best placement for a pod group. type PodGroupAssignments struct { *Placement - // ProposedAssignments maps pods to the nodes (by name) that were determined for a given placement + // ProposedAssignments associates pods with proposed nodes that were determined for a given placement // during the pod group scheduling cycle. // The pods are guaranteed to also be present in the PodGroupInfo. - ProposedAssignments map[*v1.Pod]string + ProposedAssignments []ProposedAssignment }