MCPcopy
hub / github.com/kubernetes/kubernetes / Filter

Method Filter

pkg/scheduler/framework/runtime/batch_test.go:126–135  ·  view source on GitHub ↗

Test plugin assumes that each node can hold only one pod whose id begins with blockingPrefix. This allows us to construct pods that block future selves or not.

(ctx context.Context, state fwk.CycleState, pod *v1.Pod, nodeInfo fwk.NodeInfo)

Source from the content-addressed store, hash-verified

124// Test plugin assumes that each node can hold only one pod whose id begins with blockingPrefix. This allows
125// us to construct pods that block future selves or not.
126func (pl *BatchTestPlugin) Filter(ctx context.Context, state fwk.CycleState, pod *v1.Pod, nodeInfo fwk.NodeInfo) *fwk.Status {
127 podID := pod.GetUID()
128 for _, nodePod := range nodeInfo.GetPods() {
129 npid := nodePod.GetPod().GetUID()
130 if podID[0] == blockingPodPrefix && npid[0] == blockingPodPrefix {
131 return fwk.NewStatus(fwk.Unschedulable, "unsched")
132 }
133 }
134 return nil
135}
136
137func newBatchTestPlugin(_ context.Context, injArgs runtime.Object, f fwk.Handle) (fwk.Plugin, error) {
138 return &BatchTestPlugin{}, nil

Callers

nothing calls this directly

Calls 3

GetUIDMethod · 0.65
GetPodsMethod · 0.65
GetPodMethod · 0.65

Tested by

no test coverage detected