Skip to content

Commit

Permalink
refactor: standard name
Browse files Browse the repository at this point in the history
  • Loading branch information
slipegg committed Nov 6, 2024
1 parent 5da017c commit 1826bef
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@ func (pl *InterPodAffinity) updateStateByVictims(state *utils.PreFilterState, ha
continue
}

splitPlods, err := binderutils.SplitPods(victimsMap)
launcherToPods, err := binderutils.GroupPodsByLauncher(victimsMap)
if err != nil {
return err
}

for podLanucher, pods := range splitPlods {
for podLanucher, pods := range launcherToPods {
nodeLabels := nodeInfo.GetNodeLabels(podLanucher)
for _, pod := range pods {
podInfo := framework.NewPodInfo(pod)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,12 @@ func (pl *PodTopologySpreadCheck) updateStateByVictims(state *utils.PreFilterSta
continue
}

podMap, err := binderutils.SplitPods(victimsMap)
launcherToPods, err := binderutils.GroupPodsByLauncher(victimsMap)
if err != nil {
return err
}

for podLanucher, pods := range podMap {
for podLanucher, pods := range launcherToPods {
nodeLabels := nodeInfo.GetNodeLabels(podLanucher)
for _, constraint := range state.Constraints {
pair := utils.TopologyPair{Key: constraint.TopologyKey, Value: nodeLabels[constraint.TopologyKey]}
Expand Down
2 changes: 1 addition & 1 deletion pkg/binder/utils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func CleanupPodAnnotations(client clientset.Interface, pod *v1.Pod) error {
return nil
}

func SplitPods(pods map[types.UID]*v1.Pod) (map[podutil.PodLauncher][]*v1.Pod, error) {
func GroupPodsByLauncher(pods map[types.UID]*v1.Pod) (map[podutil.PodLauncher][]*v1.Pod, error) {
podMap := make(map[podutil.PodLauncher][]*v1.Pod)

for _, pod := range pods {
Expand Down

0 comments on commit 1826bef

Please sign in to comment.