Skip to content

Commit

Permalink
Merge pull request #2929 from Monokaix/dev
Browse files Browse the repository at this point in the history
fix PodToplogySpread plugin violates maxSkew
  • Loading branch information
volcano-sh-bot committed Jun 30, 2023
2 parents ec0991b + 9167045 commit 9427174
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions pkg/scheduler/plugins/nodeorder/nodeorder.go
Expand Up @@ -166,41 +166,8 @@ func calculateWeight(args framework.Arguments) priorityWeight {

func (pp *nodeOrderPlugin) OnSessionOpen(ssn *framework.Session) {
weight := calculateWeight(pp.pluginArguments)
pl := ssn.PodLister
nodeMap := ssn.NodeMap

// Register event handlers to update task info in PodLister & nodeMap
ssn.AddEventHandler(&framework.EventHandler{
AllocateFunc: func(event *framework.Event) {
pod := pl.UpdateTask(event.Task, event.Task.NodeName)

nodeName := event.Task.NodeName
node, found := nodeMap[nodeName]
if !found {
klog.Warningf("node order, update pod %s/%s allocate to NOT EXIST node [%s]", pod.Namespace, pod.Name, nodeName)
} else {
node.AddPod(pod)
klog.V(4).Infof("node order, update pod %s/%s allocate to node [%s]", pod.Namespace, pod.Name, nodeName)
}
},
DeallocateFunc: func(event *framework.Event) {
pod := pl.UpdateTask(event.Task, "")

nodeName := event.Task.NodeName
node, found := nodeMap[nodeName]
if !found {
klog.Warningf("node order, update pod %s/%s allocate from NOT EXIST node [%s]", pod.Namespace, pod.Name, nodeName)
} else {
err := node.RemovePod(pod)
if err != nil {
klog.Errorf("Failed to update pod %s/%s and deallocate from node [%s]: %s", pod.Namespace, pod.Name, nodeName, err.Error())
} else {
klog.V(4).Infof("node order, update pod %s/%s deallocate from node [%s]", pod.Namespace, pod.Name, nodeName)
}
}
},
})

fts := feature.Features{
EnableReadWriteOncePod: utilFeature.DefaultFeatureGate.Enabled(features.ReadWriteOncePod),
EnableVolumeCapacityPriority: utilFeature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority),
Expand Down

0 comments on commit 9427174

Please sign in to comment.