Documentation
¶
Index ¶
- Constants
- func AddLabelAndPatch(ctx context.Context, kubeClient *kubernetes.Clientset, ...) error
- func CleanUpJob(ctx context.Context, kubeClient *kubernetes.Clientset, namespace, name string)
- func CleanUpKueueInstance(ctx context.Context, kueueClientset *kueueclient.Clientset, name string, ...)
- func CleanUpObject(ctx context.Context, kubeClient client.Client, obj client.Object)
- func CleanUpWorkload(ctx context.Context, kueueClient *upstreamkueueclient.Clientset, ...)
- func CreateClusterQueue(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
- func CreateJob(kubeClient *kubernetes.Clientset, job *batchv1.Job) (func(), error)
- func CreateLocalQueue(ctx context.Context, client *upstreamkueueclient.Clientset, ...) (func(), error)
- func CreateNamespace(kubeClient *kubernetes.Clientset, namespace *corev1.Namespace) (func(), error)
- func CreatePod(kubeClient *kubernetes.Clientset, pod *corev1.Pod) (func(), error)
- func CreateResourceFlavor(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
- func CreateWorkload(client *upstreamkueueclient.Clientset, ...) (func(), error)
- func DumpKueueControllerManagerLogs(ctx context.Context, kubeClient *kubernetes.Clientset, tailLines int64)
- func GetContainerImageForWorkloads() string
- func GetVisibilityClientV1beta2(user string) (visibilityv1beta2.VisibilityV1beta2Interface, error)
- func IsJobSetRunning(ctx context.Context, genericClient client.Client, jobSet *jobsetapi.JobSet) (bool, error)
- func IsJobSuspended(ctx context.Context, kubeClient *kubernetes.Clientset, ...) bool
- func IsPodScheduled(ctx context.Context, kubeClient *kubernetes.Clientset, ...) bool
- func WaitForAllPodsInNamespaceDeleted(ctx context.Context, c client.Client, ns *corev1.Namespace)
- type ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) Create(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
- func (cqw *ClusterQueueWrapper) CreateWithObject(ctx context.Context, client *upstreamkueueclient.Clientset) (*kueuev1beta2.ClusterQueue, func(), error)
- func (cqw *ClusterQueueWrapper) WithBorrowingLimit(resourceName corev1.ResourceName, limit string) *ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) WithCPU(cpu string) *ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) WithCohort(cohort string) *ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) WithFlavorName(flavorName string) *ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) WithGenerateName() *ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) WithMemory(memory string) *ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) WithPreemption(withinClusterQueue kueuev1beta2.PreemptionPolicy) *ClusterQueueWrapper
- func (cqw *ClusterQueueWrapper) WithReclaimWithinCohort(policy kueuev1beta2.PreemptionPolicy) *ClusterQueueWrapper
- type KueueWrapper
- type LeaderWorkerSetOptions
- type LocalQueueWrapper
- func (lqw *LocalQueueWrapper) Create(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
- func (lqw *LocalQueueWrapper) CreateWithObject(ctx context.Context, client *upstreamkueueclient.Clientset) (*kueuev1beta2.LocalQueue, func(), error)
- func (lqw *LocalQueueWrapper) WithClusterQueue(clusterQueue string) *LocalQueueWrapper
- func (lqw *LocalQueueWrapper) WithGenerateName() *LocalQueueWrapper
- type PodWrapper
- type ResourceFlavorWrapper
- func (rfw *ResourceFlavorWrapper) Create(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
- func (rfw *ResourceFlavorWrapper) CreateWithObject(ctx context.Context, client *upstreamkueueclient.Clientset) (*kueuev1beta2.ResourceFlavor, func(), error)
- func (rfw *ResourceFlavorWrapper) WithGenerateName() *ResourceFlavorWrapper
- type TestClients
- type TestResourceBuilder
- func (b *TestResourceBuilder) NewDeployment() *appsv1.Deployment
- func (b *TestResourceBuilder) NewDeploymentWithoutQueue() *appsv1.Deployment
- func (b *TestResourceBuilder) NewJob() *batchv1.Job
- func (b *TestResourceBuilder) NewJobSet() *jobsetapi.JobSet
- func (b *TestResourceBuilder) NewJobSetWithoutQueue() *jobsetapi.JobSet
- func (b *TestResourceBuilder) NewJobWithoutQueue() *batchv1.Job
- func (b *TestResourceBuilder) NewLeaderWorkerSet(opts LeaderWorkerSetOptions) *lwsapi.LeaderWorkerSet
- func (b *TestResourceBuilder) NewPod() *corev1.Pod
- func (b *TestResourceBuilder) NewPodWithoutQueue() *corev1.Pod
- func (b *TestResourceBuilder) NewStatefulSet() *appsv1.StatefulSet
- func (b *TestResourceBuilder) NewStatefulSetWithoutQueue() *appsv1.StatefulSet
Constants ¶
const ( OperatorReadyTime = 3 * time.Minute OperatorPoll = 10 * time.Second OperatorNamespace = "openshift-kueue-operator" OpenShiftManagedLabel = "kueue.openshift.io/managed" QueueLabel = "kueue.x-k8s.io/queue-name" DefaultLocalQueueName = "default" DeletionTime = 3 * time.Minute DeletionPoll = 5 * time.Second ConsistentlyTimeout = 5 * time.Second ConsistentlyPoll = 1 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func AddLabelAndPatch ¶
func CleanUpJob ¶
func CleanUpJob(ctx context.Context, kubeClient *kubernetes.Clientset, namespace, name string)
CleanUpJob deletes the specified Job in the given namespace.
func CleanUpKueueInstance ¶
func CleanUpKueueInstance(ctx context.Context, kueueClientset *kueueclient.Clientset, name string, kubeClient *kubernetes.Clientset)
CleanUpKueueInstance deletes the specified Kueue instance and waits for its removal. It also waits for webhook endpointslices to be completely gone if kubeClient is provided.
func CleanUpObject ¶
CleanUpObject deletes the specified kubernetes object and waits for its removal.
func CleanUpWorkload ¶
func CleanUpWorkload(ctx context.Context, kueueClient *upstreamkueueclient.Clientset, namespace, name string)
CleanUpWorkload deletes the specified Kueue Workload in the given namespace.
func CreateClusterQueue ¶
func CreateClusterQueue(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
func CreateLocalQueue ¶
func CreateNamespace ¶
func CreateNamespace(kubeClient *kubernetes.Clientset, namespace *corev1.Namespace) (func(), error)
func CreateResourceFlavor ¶
func CreateResourceFlavor(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
func CreateWorkload ¶
func CreateWorkload(client *upstreamkueueclient.Clientset, namespace, queueName, workloadName string) (func(), error)
func DumpKueueControllerManagerLogs ¶
func DumpKueueControllerManagerLogs(ctx context.Context, kubeClient *kubernetes.Clientset, tailLines int64)
DumpKueueControllerManagerLogs dumps the logs from kueue-controller-manager pods when a test fails. This should be called from JustAfterEach.
func GetContainerImageForWorkloads ¶
func GetContainerImageForWorkloads() string
func GetVisibilityClientV1beta2 ¶
func GetVisibilityClientV1beta2(user string) (visibilityv1beta2.VisibilityV1beta2Interface, error)
func IsJobSetRunning ¶
func IsJobSuspended ¶
func IsPodScheduled ¶
Types ¶
type ClusterQueueWrapper ¶
type ClusterQueueWrapper struct {
*kueuev1beta2.ClusterQueue
}
ClusterQueueWrapper wraps a ClusterQueue and provides builder methods.
func NewClusterQueue ¶
func NewClusterQueue() *ClusterQueueWrapper
NewClusterQueue creates a new wrapper with default values.
func (*ClusterQueueWrapper) Create ¶
func (cqw *ClusterQueueWrapper) Create(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
Create creates the ClusterQueue in the cluster and returns cleanup function.
func (*ClusterQueueWrapper) CreateWithObject ¶
func (cqw *ClusterQueueWrapper) CreateWithObject(ctx context.Context, client *upstreamkueueclient.Clientset) (*kueuev1beta2.ClusterQueue, func(), error)
CreateWithObject creates the ClusterQueue in the cluster and returns the created object, cleanup function, and error.
func (*ClusterQueueWrapper) WithBorrowingLimit ¶
func (cqw *ClusterQueueWrapper) WithBorrowingLimit(resourceName corev1.ResourceName, limit string) *ClusterQueueWrapper
WithBorrowingLimit sets the borrowing limit for a specific resource. resourceName is the name of the resource (e.g., "cpu", "memory"). limit is the maximum amount that can be borrowed from the cohort.
func (*ClusterQueueWrapper) WithCPU ¶
func (cqw *ClusterQueueWrapper) WithCPU(cpu string) *ClusterQueueWrapper
WithCPU sets the CPU quota.
func (*ClusterQueueWrapper) WithCohort ¶
func (cqw *ClusterQueueWrapper) WithCohort(cohort string) *ClusterQueueWrapper
WithCohort sets the cohort name for the ClusterQueue.
func (*ClusterQueueWrapper) WithFlavorName ¶
func (cqw *ClusterQueueWrapper) WithFlavorName(flavorName string) *ClusterQueueWrapper
WithFlavorName sets the resource flavor name.
func (*ClusterQueueWrapper) WithGenerateName ¶
func (cqw *ClusterQueueWrapper) WithGenerateName() *ClusterQueueWrapper
WithGenerateName switches to using GenerateName with "cluster-queue-" prefix.
func (*ClusterQueueWrapper) WithMemory ¶
func (cqw *ClusterQueueWrapper) WithMemory(memory string) *ClusterQueueWrapper
WithMemory sets the memory quota.
func (*ClusterQueueWrapper) WithPreemption ¶
func (cqw *ClusterQueueWrapper) WithPreemption(withinClusterQueue kueuev1beta2.PreemptionPolicy) *ClusterQueueWrapper
WithPreemption sets the preemption policy for the ClusterQueue. withinClusterQueue controls preemption within the same ClusterQueue (e.g., "LowerPriority", "Never").
func (*ClusterQueueWrapper) WithReclaimWithinCohort ¶
func (cqw *ClusterQueueWrapper) WithReclaimWithinCohort(policy kueuev1beta2.PreemptionPolicy) *ClusterQueueWrapper
WithReclaimWithinCohort sets the reclaimWithinCohort preemption policy. This controls whether a pending workload can preempt workloads from other ClusterQueues in the cohort.
type KueueWrapper ¶
func NewKueueDefault ¶
func NewKueueDefault() *KueueWrapper
NewKueueDefault returns a default Kueue instance for testing
func (*KueueWrapper) EnableDebug ¶
func (k *KueueWrapper) EnableDebug() *KueueWrapper
func (*KueueWrapper) GetKueue ¶
func (k *KueueWrapper) GetKueue() *ssv1.Kueue
type LeaderWorkerSetOptions ¶
type LocalQueueWrapper ¶
type LocalQueueWrapper struct {
*kueuev1beta2.LocalQueue
}
LocalQueueWrapper wraps a LocalQueue and provides builder methods.
func NewLocalQueue ¶
func NewLocalQueue(namespace, name string) *LocalQueueWrapper
NewLocalQueue creates a new wrapper with default values.
func (*LocalQueueWrapper) Create ¶
func (lqw *LocalQueueWrapper) Create(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
Create creates the LocalQueue in the cluster and returns cleanup function.
func (*LocalQueueWrapper) CreateWithObject ¶
func (lqw *LocalQueueWrapper) CreateWithObject(ctx context.Context, client *upstreamkueueclient.Clientset) (*kueuev1beta2.LocalQueue, func(), error)
CreateWithObject creates the LocalQueue in the cluster and returns the created object, cleanup function, and error.
func (*LocalQueueWrapper) WithClusterQueue ¶
func (lqw *LocalQueueWrapper) WithClusterQueue(clusterQueue string) *LocalQueueWrapper
WithClusterQueue sets the ClusterQueue name.
func (*LocalQueueWrapper) WithGenerateName ¶
func (lqw *LocalQueueWrapper) WithGenerateName() *LocalQueueWrapper
WithGenerateName switches to using GenerateName with "local-queue-" prefix.
type PodWrapper ¶
PodWrapper wraps a Pod.
func MakeCurlMetricsPod ¶
func MakeCurlMetricsPod(namespace string) *PodWrapper
func MakePod ¶
func MakePod(name, ns string) *PodWrapper
type ResourceFlavorWrapper ¶
type ResourceFlavorWrapper struct {
*kueuev1beta2.ResourceFlavor
}
ResourceFlavorWrapper wraps a ResourceFlavor and provides builder methods.
func NewResourceFlavor ¶
func NewResourceFlavor() *ResourceFlavorWrapper
NewResourceFlavor creates a new wrapper with default values.
func (*ResourceFlavorWrapper) Create ¶
func (rfw *ResourceFlavorWrapper) Create(ctx context.Context, client *upstreamkueueclient.Clientset) (func(), error)
Create creates the ResourceFlavor in the cluster and returns cleanup function.
func (*ResourceFlavorWrapper) CreateWithObject ¶
func (rfw *ResourceFlavorWrapper) CreateWithObject(ctx context.Context, client *upstreamkueueclient.Clientset) (*kueuev1beta2.ResourceFlavor, func(), error)
CreateWithObject creates the ResourceFlavor in the cluster and returns the created object, cleanup function, and error.
func (*ResourceFlavorWrapper) WithGenerateName ¶
func (rfw *ResourceFlavorWrapper) WithGenerateName() *ResourceFlavorWrapper
WithGenerateName switches to using GenerateName with "resource-flavor-" prefix.
type TestClients ¶
type TestClients struct {
GenericClient client.Client
KubeClient *kubernetes.Clientset
APIExtClient *apiextv1.ApiextensionsV1Client
KueueClient *kueueclient.Clientset
UpstreamKueueClient *upstreamkueueclient.Clientset
DynamicClient dynamic.Interface
ApiregistrationClient *apiregistrationv1client.ApiregistrationV1Client
RestConfig *rest.Config
}
func NewTestClients ¶
func NewTestClients() *TestClients
type TestResourceBuilder ¶
type TestResourceBuilder struct {
// contains filtered or unexported fields
}
func NewTestResourceBuilder ¶
func NewTestResourceBuilder(namespace, queueName string) *TestResourceBuilder
func (*TestResourceBuilder) NewDeployment ¶
func (b *TestResourceBuilder) NewDeployment() *appsv1.Deployment
func (*TestResourceBuilder) NewDeploymentWithoutQueue ¶
func (b *TestResourceBuilder) NewDeploymentWithoutQueue() *appsv1.Deployment
func (*TestResourceBuilder) NewJob ¶
func (b *TestResourceBuilder) NewJob() *batchv1.Job
func (*TestResourceBuilder) NewJobSet ¶
func (b *TestResourceBuilder) NewJobSet() *jobsetapi.JobSet
func (*TestResourceBuilder) NewJobSetWithoutQueue ¶
func (b *TestResourceBuilder) NewJobSetWithoutQueue() *jobsetapi.JobSet
func (*TestResourceBuilder) NewJobWithoutQueue ¶
func (b *TestResourceBuilder) NewJobWithoutQueue() *batchv1.Job
func (*TestResourceBuilder) NewLeaderWorkerSet ¶
func (b *TestResourceBuilder) NewLeaderWorkerSet(opts LeaderWorkerSetOptions) *lwsapi.LeaderWorkerSet
NewLeaderWorkerSet creates a LeaderWorkerSet with optional queue name, priority class, and size.
func (*TestResourceBuilder) NewPod ¶
func (b *TestResourceBuilder) NewPod() *corev1.Pod
func (*TestResourceBuilder) NewPodWithoutQueue ¶
func (b *TestResourceBuilder) NewPodWithoutQueue() *corev1.Pod
func (*TestResourceBuilder) NewStatefulSet ¶
func (b *TestResourceBuilder) NewStatefulSet() *appsv1.StatefulSet
func (*TestResourceBuilder) NewStatefulSetWithoutQueue ¶
func (b *TestResourceBuilder) NewStatefulSetWithoutQueue() *appsv1.StatefulSet