util

package
v0.20.11 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 65 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildKubeConfigFile

func BuildKubeConfigFile(config *restclient.Config) string

func InitTestSchedulerWithOptions

func InitTestSchedulerWithOptions(
	t *testing.T,
	testCtx *testutils.TestContext,
	startScheduler bool,
	opts ...scheduler.Option,
) *testutils.TestContext

InitTestSchedulerWithOptions initializes a test environment and creates a scheduler with default configuration and other options. TODO(Huang-Wei): refactor the same function in the upstream, and remove here.

func IntegrationEtcdServers

func IntegrationEtcdServers() []string

func MakeNodesAndPods

func MakeNodesAndPods(labels map[string]string, existingPodsNum, allNodesNum int) (existingPods []*corev1.Pod, allNodes []*corev1.Node)

func MakePG

func MakePG(name, namespace string, min int32, creationTime *time.Time, minResource *corev1.ResourceList) *v1alpha1.PodGroup

func MakePod

func MakePod(podName string, namespace string, memReq int64, cpuReq int64, priority int32, uid string, nodeName string) *corev1.Pod

func NewFakeSharedLister

func NewFakeSharedLister(pods []*v1.Pod, nodes []*v1.Node) framework.SharedLister

func NewFramework

func NewFramework(fns []st.RegisterPluginFunc, cfgs []config.PluginConfig, profileName string, opts ...runtime.Option) (framework.Framework, error)

NewFramework is a variant version of st.NewFramework - with extra PluginConfig slice as input.

func NewPodNominator

func NewPodNominator() framework.PodNominator

NewPodNominator creates a nominatedPodMap as a backing of framework.PodNominator.

func NominatedNodeName

func NominatedNodeName(pod *v1.Pod) string

NominatedNodeName returns nominated node name of a Pod.

func PrintPods

func PrintPods(t *testing.T, cs clientset.Interface, ns string)

func StartApi

func StartApi(t *testing.T, stopCh <-chan struct{}) (client.Interface, *rest.Config)

StartApi runs a kube-apiserver, optionally calling out to the setup.ModifyServerRunOptions and setup.ModifyServerConfig functions

Types

type TestServerSetup

type TestServerSetup struct {
	ModifyServerRunOptions func(*options.ServerRunOptions)
	ModifyServerConfig     func(*controlplane.Config)
}

TestServerSetup holds configuration information for a kube-apiserver test server.

Jump to

Keyboard shortcuts

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