workload

package
v0.2.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 InCondition added in v0.2.0

func InCondition(w *kueue.Workload, condition string) bool

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 UpdateStatus

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

UpdateStatus updates the condition of a workload.

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) 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]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