env_tests

package
v0.9.4-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNodeObject

func CreateNodeObject(ctx context.Context, c client.Client, config NodeConfig) *corev1.Node

CreateNode creates a node with the specified configuration

func CreatePodObject

func CreatePodObject(namespace, name string, resources corev1.ResourceRequirements) *corev1.Pod

func CreateQueueObject

func CreateQueueObject(queueName, parentName string) *schedulingv2.Queue

func DeleteAllInNamespace

func DeleteAllInNamespace(ctx context.Context, c client.Client, namespace string, resources ...client.Object) error

func GroupPods

func GroupPods(ctx context.Context, c client.Client, podGroupConfig podGroupConfig, pods []*corev1.Pod) error

func PrettyPrintBindRequest

func PrettyPrintBindRequest(bindRequest *kaiv1alpha2.BindRequest) string

func PrettyPrintBindRequestList

func PrettyPrintBindRequestList(bindRequestList *kaiv1alpha2.BindRequestList) string

func WaitForNoObjectsInNamespace

func WaitForNoObjectsInNamespace(ctx context.Context, c client.Client, namespace string, timeout, interval time.Duration, resources ...client.ObjectList) error

func WaitForObjectDeletion

func WaitForObjectDeletion(ctx context.Context, c client.Client, obj client.Object, timeout, interval time.Duration) error

func WaitForPodBound

func WaitForPodBound(ctx context.Context, c client.Client, podName, namespace string, timeout, interval time.Duration) error

WaitForPodBound waits for a pod to be bound (have a NodeName set)

func WaitForPodScheduled

func WaitForPodScheduled(ctx context.Context, c client.Client, podName, namespace string, timeout, interval time.Duration) error

WaitForPodScheduled waits for a pod to be scheduled (have a bind request created)

func WaitForPodUnschedulable added in v0.5.1

func WaitForPodUnschedulable(ctx context.Context, c client.Client, podName, namespace string, timeout, interval time.Duration) error

WaitForPodUnschedulable waits for a pod to be unschedulable

Types

type NodeConfig

type NodeConfig struct {
	Name        string
	CPUs        string // CPU capacity in cores
	Memory      string // Memory capacity in bytes
	GPUs        int    // Number of GPUs
	Labels      map[string]string
	Annotations map[string]string
}

NodeConfig holds the configuration for a test node

func DefaultNodeConfig

func DefaultNodeConfig(name string) NodeConfig

DefaultNodeConfig returns a default node configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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