testing

package
v0.0.0-...-dcfb068 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 20 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 NewSchedulerFrameworkHandle

func NewSchedulerFrameworkHandle(
	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,
) (framework.SchedulerFrameworkHandle, error)

func NewSchedulerFrameworkHandleWithPodGroup

func NewSchedulerFrameworkHandleWithPodGroup(
	client clientset.Interface,
	crdClient godelclient.Interface,
	informerFactory informers.SharedInformerFactory,
	snapshot *godelcache.Snapshot,
	podGroupInfoCache map[string]*schedulingv1a1.PodGroup,
) (framework.SchedulerFrameworkHandle, 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 MockSchedulerFrameworkHandle

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

func (*MockSchedulerFrameworkHandle) CRDSharedInformerFactory

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

func (*MockSchedulerFrameworkHandle) CachePreemptionPolicy

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

func (*MockSchedulerFrameworkHandle) CleanupPreemptionPolicyForPodOwner

func (mfh *MockSchedulerFrameworkHandle) CleanupPreemptionPolicyForPodOwner()

func (*MockSchedulerFrameworkHandle) ClientSet

func (*MockSchedulerFrameworkHandle) GetFrameworkForPod

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

func (*MockSchedulerFrameworkHandle) GetLoadAwareNodeMetricInfo

func (mfh *MockSchedulerFrameworkHandle) GetLoadAwareNodeMetricInfo(nodeName string, resourceType podutil.PodResourceType) *framework.LoadAwareNodeMetricInfo

func (*MockSchedulerFrameworkHandle) GetLoadAwareNodeUsage

func (mfh *MockSchedulerFrameworkHandle) GetLoadAwareNodeUsage(nodeName string, resourceType podutil.PodResourceType) *framework.LoadAwareNodeUsage

func (*MockSchedulerFrameworkHandle) GetOwnerLabels

func (mfh *MockSchedulerFrameworkHandle) GetOwnerLabels(ownerType, ownerKey string) map[string]string

func (*MockSchedulerFrameworkHandle) GetPDBItemList

func (mfh *MockSchedulerFrameworkHandle) GetPDBItemList() []framework.PDBItem

func (*MockSchedulerFrameworkHandle) GetPDBItemListForOwner

func (mfh *MockSchedulerFrameworkHandle) GetPDBItemListForOwner(ownerType, ownerKey string) (bool, bool, []string)

func (*MockSchedulerFrameworkHandle) GetPodGroupInfo

func (mfh *MockSchedulerFrameworkHandle) GetPodGroupInfo(podGroupName string) (*schedulingv1a1.PodGroup, error)

func (*MockSchedulerFrameworkHandle) GetPotentialVictims

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

func (*MockSchedulerFrameworkHandle) GetPreemptionFrameworkForPod

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

func (*MockSchedulerFrameworkHandle) GetPreemptionPolicy

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

func (*MockSchedulerFrameworkHandle) SchedulerName

func (mfh *MockSchedulerFrameworkHandle) SchedulerName() string

func (*MockSchedulerFrameworkHandle) SetPotentialVictims

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

func (*MockSchedulerFrameworkHandle) SharedInformerFactory

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

func (*MockSchedulerFrameworkHandle) SnapshotSharedLister

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

func (*MockSchedulerFrameworkHandle) SubCluster

func (mfh *MockSchedulerFrameworkHandle) SubCluster() string

func (*MockSchedulerFrameworkHandle) 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