testing

package
v0.0.0-...-6111fc0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ErrReasonFake = "Nodes failed the fake plugin"

ErrReasonFake is a fake error message denotes the filter function errored.

View Source
const TestSchedulerName = "test-scheduler"

Variables

This section is empty.

Functions

func NewFakeFilterPlugin

func NewFakeFilterPlugin(failedNodeReturnCodeMap map[string]framework.Code) (framework.Plugin, error)

NewFakeFilterPlugin initializes a fakeFilterPlugin and returns it.

func NewFakePreFilterPlugin

func NewFakePreFilterPlugin(status *framework.Status) (framework.Plugin, error)

// NewFakePreFilterPlugin initializes a fakePreFilterPlugin and returns it.

func NewFalseFilterPlugin

NewFalseFilterPlugin initializes a FalseFilterPlugin and returns it.

func NewMatchFilterPlugin

NewMatchFilterPlugin initializes a MatchFilterPlugin and returns it.

func NewPodFrameworkHandle

func NewPodFrameworkHandle(
	client clientset.Interface,
	crdClient godelclient.Interface,
	informerFactory informers.SharedInformerFactory,
	crdInformerFactory crdinformers.SharedInformerFactory,
	cache godelcache.SchedulerCache,
	snapshot *godelcache.Snapshot,
	pluginRegistry framework.PluginMap,
	preemptionPluginRegistry framework.PluginMap,
	orderedPluginRegistry framework.PluginList,
	basePlugins *framework.PluginCollection,
) (handle.PodFrameworkHandle, error)

func NewSchedulerPodFramework

func NewSchedulerPodFramework(pluginRegistry framework.PluginMap, orderedPluginRegistry framework.PluginList, basePlugins, hardConstraints, softConstraints *framework.PluginCollection) (framework.SchedulerFramework, error)

func NewTrueFilterPlugin

NewTrueFilterPlugin initializes a TrueFilterPlugin and returns it.

Types

type FakeFilterPlugin

type FakeFilterPlugin struct {
	NumFilterCalled         int32
	FailedNodeReturnCodeMap map[string]framework.Code
}

FakeFilterPlugin is a test filter plugin to record how many times its Filter() function have been called, and it returns different 'Code' depending on its internal 'failedNodeReturnCodeMap'.

func (*FakeFilterPlugin) Filter

func (pl *FakeFilterPlugin) Filter(_ context.Context, pod *v1.Pod, nodeInfo framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point.

func (*FakeFilterPlugin) Name

func (pl *FakeFilterPlugin) Name() string

Name returns name of the plugin.

type FakePreFilterPlugin

type FakePreFilterPlugin struct {
	Status *framework.Status
}

FakePreFilterPlugin is a test filter plugin.

func (*FakePreFilterPlugin) Name

func (pl *FakePreFilterPlugin) Name() string

Name returns name of the plugin.

func (*FakePreFilterPlugin) PreFilter

func (pl *FakePreFilterPlugin) PreFilter(_ context.Context, pod *v1.Pod) *framework.Status

PreFilter invoked at the PreFilter extension point.

type FalseFilterPlugin

type FalseFilterPlugin struct{}

FalseFilterPlugin is a filter plugin which always return Unschedulable when Filter function is called.

func (*FalseFilterPlugin) Filter

func (pl *FalseFilterPlugin) Filter(_ context.Context, pod *v1.Pod, nodeInfo framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point.

func (*FalseFilterPlugin) Name

func (pl *FalseFilterPlugin) Name() string

Name returns name of the plugin.

type MatchFilterPlugin

type MatchFilterPlugin struct{}

MatchFilterPlugin is a filter plugin which return Success when the evaluated pod and node have the same name; otherwise return Unschedulable.

func (*MatchFilterPlugin) Filter

func (pl *MatchFilterPlugin) Filter(_ context.Context, pod *v1.Pod, nodeInfo framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point.

func (*MatchFilterPlugin) Name

func (pl *MatchFilterPlugin) Name() string

Name returns name of the plugin.

type MockPodFrameworkHandle

type MockPodFrameworkHandle struct {
	// contains filtered or unexported fields
}

func (*MockPodFrameworkHandle) CRDSharedInformerFactory

func (mfh *MockPodFrameworkHandle) CRDSharedInformerFactory() crdinformers.SharedInformerFactory

func (*MockPodFrameworkHandle) CachePreemptionPolicy

func (mfh *MockPodFrameworkHandle) CachePreemptionPolicy(deployName string, policyName string)

func (*MockPodFrameworkHandle) CleanupPreemptionPolicyForPodOwner

func (mfh *MockPodFrameworkHandle) CleanupPreemptionPolicyForPodOwner()

func (*MockPodFrameworkHandle) ClientSet

func (mfh *MockPodFrameworkHandle) ClientSet() clientset.Interface

func (*MockPodFrameworkHandle) FindStore

func (mfh *MockPodFrameworkHandle) FindStore(storeName commonstore.StoreName) commonstore.Store

func (*MockPodFrameworkHandle) GetFrameworkForPod

func (mfh *MockPodFrameworkHandle) GetFrameworkForPod(pod *v1.Pod) (f framework.SchedulerFramework, err error)

func (*MockPodFrameworkHandle) GetPotentialVictims

func (mfh *MockPodFrameworkHandle) GetPotentialVictims(node string) []string

func (*MockPodFrameworkHandle) GetPreemptionFrameworkForPod

func (mfh *MockPodFrameworkHandle) GetPreemptionFrameworkForPod(_ *v1.Pod) framework.SchedulerPreemptionFramework

func (*MockPodFrameworkHandle) GetPreemptionPolicy

func (mfh *MockPodFrameworkHandle) GetPreemptionPolicy(deployName string) string

func (*MockPodFrameworkHandle) SchedulerName

func (mfh *MockPodFrameworkHandle) SchedulerName() string

func (*MockPodFrameworkHandle) SetPotentialVictims

func (mfh *MockPodFrameworkHandle) SetPotentialVictims(node string, potentialVictims []string)

func (*MockPodFrameworkHandle) SharedInformerFactory

func (mfh *MockPodFrameworkHandle) SharedInformerFactory() informers.SharedInformerFactory

func (*MockPodFrameworkHandle) SnapshotSharedLister

func (mfh *MockPodFrameworkHandle) SnapshotSharedLister() framework.SharedLister

func (*MockPodFrameworkHandle) SubCluster

func (mfh *MockPodFrameworkHandle) SubCluster() string

func (*MockPodFrameworkHandle) SwitchType

func (mfh *MockPodFrameworkHandle) SwitchType() framework.SwitchType

type TrueFilterPlugin

type TrueFilterPlugin struct{}

TrueFilterPlugin is a filter plugin which always return Success when Filter function is called.

func (*TrueFilterPlugin) Filter

func (pl *TrueFilterPlugin) Filter(_ context.Context, pod *v1.Pod, nodeInfo framework.NodeInfo) *framework.Status

Filter invoked at the filter extension point.

func (*TrueFilterPlugin) Name

func (pl *TrueFilterPlugin) Name() string

Name returns name of the plugin.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL