workload

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AdmissionPatch added in v0.3.0

func AdmissionPatch(w *kueue.Workload) *kueue.Workload

AdmissionPatch creates a new object based on the input workload that contains the admission. The object can be used in Server-Side-Apply.

func BaseSSAWorkload added in v0.3.0

func BaseSSAWorkload(w *kueue.Workload) *kueue.Workload

BaseSSAWorkload creates a new object based on the input workload that only contains the fields necessary to identify the original object. The object can be used in as a base for Server-Side-Apply.

func FindConditionIndex

func FindConditionIndex(status *kueue.WorkloadStatus, conditionType string) 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 QueueKey added in v0.2.0

func QueueKey(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 UnsetAdmissionWithCondition added in v0.3.0

func UnsetAdmissionWithCondition(
	ctx context.Context,
	c client.Client,
	wl *kueue.Workload,
	reason, message string) error

func UpdateStatus

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

UpdateStatus updates the condition of a workload with ssa, filelManager being set to managerPrefix + "-" + conditionType

func UpdateStatusIfChanged added in v0.2.0

func UpdateStatusIfChanged(ctx context.Context,
	c client.Client,
	wl *kueue.Workload,
	conditionType string,
	conditionStatus metav1.ConditionStatus,
	reason, message string,
	managerPrefix string) error

Types

type Info

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

Info holds a Workload object and some pre-processing.

func NewInfo

func NewInfo(w *kueue.Workload) *Info

func (*Info) Update added in v0.2.0

func (i *Info) Update(wl *kueue.Workload)

type PodSetResources

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

type Requests

type Requests map[corev1.ResourceName]int64

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

func (Requests) ToResourceList added in v0.3.0

func (r Requests) ToResourceList() corev1.ResourceList

Jump to

Keyboard shortcuts

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