util

package
v0.30.6 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeNodesAndPods added in v0.19.8

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

func MakePG added in v0.19.8

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

func MakePod added in v0.19.8

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

func MustNewPodInfo added in v0.26.7

func MustNewPodInfo(t testing.TB, pod *corev1.Pod) *framework.PodInfo

func NewClientOrDie added in v0.27.8

func NewClientOrDie(cfg *rest.Config) client.Client

NewClientOrDie returns a generic controller-runtime client or panic upon any error. This function is used by integration tests.

func NewDefaultSchedulerComponentConfig added in v0.22.6

func NewDefaultSchedulerComponentConfig() (config.KubeSchedulerConfiguration, error)

NewDefaultSchedulerComponentConfig returns a default scheduler cc object. We need this function due to k/k#102796 - default profile needs to built manually.

func NewFakeClient added in v0.27.8

func NewFakeClient(objs ...runtime.Object) (client.WithWatch, error)

NewFakeClient returns a generic controller-runtime client with all given `objs` as internal runtime objects. It also registers core v1 scheme, this repo's v1alpha1 scheme and topologyv1alpha2 scheme. This function is used by unit tests.

func NewFakeSharedLister added in v0.19.8

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

func NewFramework added in v0.21.6

func NewFramework(ctx context.Context, fns []tf.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 added in v0.19.8

func NewPodNominator(podLister listersv1.PodLister) framework.PodNominator

NewPodNominator creates a nominator as a backing of framework.PodNominator. A podLister is passed in so as to check if the pod exists before adding its nominatedNode info.

func NominatedNodeName added in v0.19.8

func NominatedNodeName(pod *v1.Pod) string

NominatedNodeName returns nominated node name of a Pod.

func PodNotExist added in v0.23.9

func PodNotExist(cs clientset.Interface, podNamespace, podName string) bool

PodNotExist returns true if the given pod does not exist.

func PrintPods

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

func UpdatePGStatus added in v0.26.7

func UpdatePGStatus(pg *v1alpha1.PodGroup, phase v1alpha1.PodGroupPhase, occupiedBy string, scheduled int32, running int32, succeeded int32, failed int32) *v1alpha1.PodGroup

func WithLimits added in v0.24.9

func WithLimits(p *st.PodWrapper, resMap map[string]string, initContainer bool) *st.PodWrapper

WithLimits adds a new app or init container to the inner pod with a given resource map.

func WithRequests added in v0.24.9

func WithRequests(p *st.PodWrapper, resMap map[string]string, initContainer bool) *st.PodWrapper

WithRequests adds a new app or init container to the inner pod with a given resource map.

Types

type PodGroupWrapper added in v0.27.8

type PodGroupWrapper struct{ v1alpha1.PodGroup }

func MakePodGroup added in v0.27.8

func MakePodGroup() *PodGroupWrapper

func (*PodGroupWrapper) MinMember added in v0.27.8

func (p *PodGroupWrapper) MinMember(i int32) *PodGroupWrapper

func (*PodGroupWrapper) MinResources added in v0.27.8

func (p *PodGroupWrapper) MinResources(resources map[v1.ResourceName]string) *PodGroupWrapper

func (*PodGroupWrapper) Name added in v0.27.8

func (*PodGroupWrapper) Namespace added in v0.27.8

func (p *PodGroupWrapper) Namespace(s string) *PodGroupWrapper

func (*PodGroupWrapper) Obj added in v0.27.8

func (p *PodGroupWrapper) Obj() *v1alpha1.PodGroup

func (*PodGroupWrapper) Phase added in v0.27.8

func (*PodGroupWrapper) Time added in v0.27.8

Jump to

Keyboard shortcuts

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