podset

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPodsetInfo   = errors.New("invalid podset infos")
	ErrInvalidPodSetUpdate = errors.New("invalid admission check PodSetUpdate")
)

Functions

func BadPodSetsInfoLenError

func BadPodSetsInfoLenError(want, got int) error

func BadPodSetsUpdateError

func BadPodSetsUpdateError(update string, err error) error

func IsPermanent

func IsPermanent(e error) bool

func Merge

func Merge(meta *metav1.ObjectMeta, spec *corev1.PodSpec, info PodSetInfo) error

Merge updates or appends the replica metadata & spec fields based on PodSetInfo. It returns error if there is a conflict.

func RestorePodSpec

func RestorePodSpec(meta *metav1.ObjectMeta, spec *corev1.PodSpec, info PodSetInfo) bool

RestorePodSpec sets replica metadata and spec fields based on PodSetInfo. It returns true if there is any change.

Types

type PodSetInfo

type PodSetInfo struct {
	Name            string
	Count           int32
	Annotations     map[string]string
	Labels          map[string]string
	NodeSelector    map[string]string
	Tolerations     []corev1.Toleration
	SchedulingGates []corev1.PodSchedulingGate
}

func FromAssignment

func FromAssignment(ctx context.Context, client client.Client, assignment *kueue.PodSetAssignment, defaultCount int32) (PodSetInfo, error)

FromAssignment returns a PodSetInfo based on the provided assignment and an error if unable to get any of the referenced flavors.

func FromPodSet

func FromPodSet(ps *kueue.PodSet) PodSetInfo

FromPodSet returns a PodSetInfo based on the provided PodSet

func FromUpdate

func FromUpdate(update *kueue.PodSetUpdate) PodSetInfo

FromUpdate returns a PodSetInfo based on the provided PodSetUpdate

func (*PodSetInfo) AddOrUpdateLabel added in v0.6.0

func (podSetInfo *PodSetInfo) AddOrUpdateLabel(k, v string)

AddOrUpdateLabel adds or updates the label identified by k with value v allocating a new Labels nap if nil

func (*PodSetInfo) Merge

func (podSetInfo *PodSetInfo) Merge(o PodSetInfo) error

Jump to

Keyboard shortcuts

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