workload

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindConditionIndex

func FindConditionIndex(status *kueue.WorkloadStatus, conditionType kueue.WorkloadConditionType) int

FindConditionIndex finds the provided condition from the given status and returns the index. Returns -1 if the condition is not present.

func Key

func Key(w *kueue.Workload) string

func ResourceQuantity

func ResourceQuantity(name corev1.ResourceName, v int64) resource.Quantity

func ResourceValue

func ResourceValue(name corev1.ResourceName, q resource.Quantity) int64

ResourceValue returns the integer value for the resource name. It's milli-units for CPU and absolute units for everything else.

func UpdateStatus

func UpdateStatus(ctx context.Context,
	c client.Client,
	wl *kueue.Workload,
	conditionType kueue.WorkloadConditionType,
	conditionStatus corev1.ConditionStatus,
	reason, message string) error

UpdateStatus updates the condition of a workload.

func UpdateWorkloadStatusIfChanged

func UpdateWorkloadStatusIfChanged(ctx context.Context,
	c client.Client,
	wl *kueue.Workload,
	conditionType kueue.WorkloadConditionType,
	conditionStatus corev1.ConditionStatus,
	reason, message string) error

Types

type Info

type Info struct {
	Obj *kueue.Workload
	// list of total resources requested by the podsets.
	TotalRequests []PodSetResources
	// Populated from queue.
	ClusterQueue string
}

Info holds a Workload object and some pre-processing.

func NewInfo

func NewInfo(w *kueue.Workload) *Info

type PodSetResources

type PodSetResources struct {
	Name     string
	Requests Requests
	Flavors  map[corev1.ResourceName]string
}

type Requests

type Requests map[corev1.ResourceName]int64

Requests maps ResourceName to flavor to value; for CPU it is tracked in MilliCPU.

Jump to

Keyboard shortcuts

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