test

package
v0.0.0-...-b7b0d94 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NodeReal = func() *v1.Node {
	node := v1.Node{}
	decodeYaml(yamlNodeReal, &node)
	return &node
}()

NodeReal is a realistic v1.Node used for testing and benchmarks.

View Source
var NodeSmall = &v1.Node{ObjectMeta: apimeta.ObjectMeta{Name: NodeSmallName}}

NodeSmall is the smallest node that works with URLExampleFilterSimple.

View Source
var NodeSmallName = "good-node"
View Source
var PodForHandleTest = &v1.Pod{
	ObjectMeta: apimeta.ObjectMeta{
		Name:      "handle-pod",
		Namespace: "test",
		UID:       "handle-test",
	},
	Spec: v1.PodSpec{NodeName: NodeSmall.Name},
}

PodForHandleTest is the pod for testing handle.

View Source
var PodReal = func() *v1.Pod {
	pod := v1.Pod{}
	decodeYaml(yamlPodReal, &pod)
	return &pod
}()

PodReal is a realistic v1.Pod used for testing and benchmarks.

View Source
var PodSmall = &v1.Pod{
	ObjectMeta: apimeta.ObjectMeta{
		Name:      "good-pod",
		Namespace: "test",
		UID:       "384900cd-dc7b-41ec-837e-9c4c1762363e",
	},
	Spec: v1.PodSpec{NodeName: NodeSmall.Name},
}

PodSmall is the smallest pod that works with URLExampleFilterSimple.

View Source
var URLErrorNotPlugin = localURL(pathWatError("not_plugin"))
View Source
var URLErrorPanicOnBind = localURL(pathWatError("panic_on_bind"))
View Source
var URLErrorPanicOnEnqueue = localURL(pathWatError("panic_on_enqueue"))
View Source
var URLErrorPanicOnFilter = localURL(pathWatError("panic_on_filter"))
View Source
var URLErrorPanicOnGetConfig = localURL(pathWatError("panic_on_get_config"))
View Source
var URLErrorPanicOnPermit = localURL(pathWatError("panic_on_permit"))
View Source
var URLErrorPanicOnPostBind = localURL(pathWatError("panic_on_postbind"))
View Source
var URLErrorPanicOnPostFilter = localURL(pathWatError("panic_on_postfilter"))
View Source
var URLErrorPanicOnPreBind = localURL(pathWatError("panic_on_prebind"))
View Source
var URLErrorPanicOnPreFilter = localURL(pathWatError("panic_on_prefilter"))
View Source
var URLErrorPanicOnPreFilterExtensions = localURL(pathWatError("panic_on_prefilterextensions"))
View Source
var URLErrorPanicOnPreScore = localURL(pathWatError("panic_on_prescore"))
View Source
var URLErrorPanicOnReserve = localURL(pathWatError("panic_on_reserve"))
View Source
var URLErrorPanicOnScore = localURL(pathWatError("panic_on_score"))
View Source
var URLErrorPanicOnScoreExtensions = localURL(pathWatError("panic_on_scoreextensions"))
View Source
var URLErrorPanicOnStart = localURL(pathWatError("panic_on_start"))
View Source
var URLErrorPreScoreWithoutScore = localURL(pathWatError("prescore_without_score"))
View Source
var URLErrorScoreExtensionsWithoutScore = localURL(pathWatError("scoreextensions_without_score"))
View Source
var URLExampleAdvanced = localURL(pathTinyGoExample("advanced"))
View Source
var URLExampleImageLocality = localURL(pathTinyGoExample("imagelocality"))
View Source
var URLExampleNodeNumber = localURL(pathTinyGoExample("nodenumber"))
View Source
var URLTestAllNoopWat = localURL(pathWatTest("all_noop"))
View Source
var URLTestBind = localURL(pathTinyGoTest("bind"))
View Source
var URLTestBindFromGlobal = localURL(pathWatTest("bind_from_global"))
View Source
var URLTestCycleState = localURL(pathTinyGoTest("cyclestate"))
View Source
var URLTestFilter = localURL(pathTinyGoTest("filter"))
View Source
var URLTestFilterFromGlobal = localURL(pathWatTest("filter_from_global"))
View Source
var URLTestHandle = localURL(pathTinyGoTest("handle"))
View Source
var URLTestPermit = localURL(pathTinyGoTest("permit"))
View Source
var URLTestPermitFromGlobal = localURL(pathWatTest("permit_from_global"))
View Source
var URLTestPostBindFromGlobal = localURL(pathWatTest("postbind_from_global"))
View Source
var URLTestPostFilterFromGlobal = localURL(pathWatTest("postfilter_from_global"))
View Source
var URLTestPreBindFromGlobal = localURL(pathWatTest("prebind_from_global"))
View Source
var URLTestPreFilterExtensionsFromGlobal = localURL(pathWatTest("prefilterextensions_from_global"))
View Source
var URLTestPreFilterFromGlobal = localURL(pathWatTest("prefilter_from_global"))
View Source
var URLTestPreScoreFromGlobal = localURL(pathWatTest("prescore_from_global"))
View Source
var URLTestReserve = localURL(pathTinyGoTest("reserve"))
View Source
var URLTestReserveFromGlobal = localURL(pathWatTest("reserve_from_global"))
View Source
var URLTestScore = localURL(pathTinyGoTest("score"))
View Source
var URLTestScoreExtensionsFromGlobal = localURL(pathWatTest("scoreextensions_from_global"))
View Source
var URLTestScoreFromGlobal = localURL(pathWatTest("score_from_global"))

Functions

func CapturePanic

func CapturePanic(panics func()) (captured string)

CapturePanic returns what was recovered from a panic as a string.

Note: This was originally adapted from wazero require.CapturePanic

Types

type FakeHandle

type FakeHandle struct {
	Recorder              events.EventRecorder
	RejectWaitingPodValue types.UID
	SharedLister          framework.SharedLister
}

func (*FakeHandle) AddNominatedPod

func (h *FakeHandle) AddNominatedPod(logger klog.Logger, pod *framework.PodInfo, node *framework.NominatingInfo)

func (*FakeHandle) ClientSet

func (h *FakeHandle) ClientSet() clientset.Interface

func (*FakeHandle) DeleteNominatedPodIfExists

func (h *FakeHandle) DeleteNominatedPodIfExists(pod *v1.Pod)

func (*FakeHandle) EventRecorder

func (h *FakeHandle) EventRecorder() events.EventRecorder

func (*FakeHandle) Extenders

func (h *FakeHandle) Extenders() []framework.Extender

func (*FakeHandle) GetWaitingPod

func (h *FakeHandle) GetWaitingPod(uid types.UID) (w framework.WaitingPod)

func (*FakeHandle) IterateOverWaitingPods

func (h *FakeHandle) IterateOverWaitingPods(callback func(framework.WaitingPod))

func (*FakeHandle) KubeConfig

func (h *FakeHandle) KubeConfig() *restclient.Config

func (*FakeHandle) NominatedPodsForNode

func (h *FakeHandle) NominatedPodsForNode(nodeName string) (f []*framework.PodInfo)

func (*FakeHandle) Parallelizer

func (h *FakeHandle) Parallelizer() (p parallelize.Parallelizer)

func (*FakeHandle) RejectWaitingPod

func (h *FakeHandle) RejectWaitingPod(uid types.UID) (b bool)

func (*FakeHandle) RunFilterPlugins

func (*FakeHandle) RunFilterPluginsWithNominatedPods

func (h *FakeHandle) RunFilterPluginsWithNominatedPods(ctx context.Context, state *framework.CycleState, pod *v1.Pod, info *framework.NodeInfo) (s *framework.Status)

func (*FakeHandle) RunPreFilterExtensionAddPod

func (h *FakeHandle) RunPreFilterExtensionAddPod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod, podInfoToAdd *framework.PodInfo, nodeInfo *framework.NodeInfo) (s *framework.Status)

func (*FakeHandle) RunPreFilterExtensionRemovePod

func (h *FakeHandle) RunPreFilterExtensionRemovePod(ctx context.Context, state *framework.CycleState, podToSchedule *v1.Pod, podInfoToRemove *framework.PodInfo, nodeInfo *framework.NodeInfo) (s *framework.Status)

func (*FakeHandle) RunPreScorePlugins

func (h *FakeHandle) RunPreScorePlugins(context.Context, *framework.CycleState, *v1.Pod, []*framework.NodeInfo) (s *framework.Status)

func (*FakeHandle) SharedInformerFactory

func (h *FakeHandle) SharedInformerFactory() informers.SharedInformerFactory

func (*FakeHandle) SnapshotSharedLister

func (h *FakeHandle) SnapshotSharedLister() framework.SharedLister

func (*FakeHandle) UpdateNominatedPod

func (h *FakeHandle) UpdateNominatedPod(logger klog.Logger, oldPod *v1.Pod, newPodInfo *framework.PodInfo)

type FakeNodeInfoLister

type FakeNodeInfoLister struct {
	Nodes []*framework.NodeInfo
}

func (*FakeNodeInfoLister) Get

func (*FakeNodeInfoLister) HavePodsWithAffinityList

func (c *FakeNodeInfoLister) HavePodsWithAffinityList() ([]*framework.NodeInfo, error)

func (*FakeNodeInfoLister) HavePodsWithRequiredAntiAffinityList

func (c *FakeNodeInfoLister) HavePodsWithRequiredAntiAffinityList() ([]*framework.NodeInfo, error)

func (*FakeNodeInfoLister) List

func (c *FakeNodeInfoLister) List() ([]*framework.NodeInfo, error)

type FakeRecorder

type FakeRecorder struct {
	EventMsg string
}

func (*FakeRecorder) Eventf

func (f *FakeRecorder) Eventf(regarding runtime.Object, related runtime.Object, eventtype, reason, action, note string, args ...interface{})

type FakeSharedLister

type FakeSharedLister struct {
	NodeInfoLister framework.NodeInfoLister
}

func (*FakeSharedLister) NodeInfos

func (c *FakeSharedLister) NodeInfos() framework.NodeInfoLister

func (*FakeSharedLister) StorageInfos

func (c *FakeSharedLister) StorageInfos() framework.StorageInfoLister

Jump to

Keyboard shortcuts

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