util

package
v0.20.11 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultWaitTime = 60 * time.Second

DefaultWaitTime is 60s if ScheduleTimeoutSeconds is not specified.

View Source
const (
	// PodGroupLabel is the default label of coscheduling
	PodGroupLabel = "pod-group.scheduling.sigs.k8s.io"
)

Variables

View Source
var (
	// ErrorNotMatched means pod does not match coscheduling
	ErrorNotMatched = fmt.Errorf("not match coscheduling")
	// ErrorWaiting means pod number does not match the min pods required
	ErrorWaiting = fmt.Errorf("waiting")
	// ErrorResourceNotEnough means cluster resource is not enough, mainly used in Pre-Filter
	ErrorResourceNotEnough = fmt.Errorf("resource not enough")
)

Functions

func CreateMergePatch

func CreateMergePatch(original, new interface{}) ([]byte, error)

CreateMergePatch return patch generated from original and new interfaces

func GetPodGroupFullName

func GetPodGroupFullName(pod *v1.Pod) string

GetPodGroupFullName get namespaced group name from pod annotations

func GetPodGroupLabel

func GetPodGroupLabel(pod *v1.Pod) string

GetPodGroupLabel get pod group from pod annotations

func GetWaitTimeDuration

func GetWaitTimeDuration(pg *v1alpha1.PodGroup, scheduleTimeout *time.Duration) time.Duration

GetWaitTimeDuration returns a wait timeout based on the following precedences: 1. spec.scheduleTimeoutSeconds of the given pg, if specified 2. given scheduleTimeout, if not nil 3. fall back to DefaultWaitTime

Types

This section is empty.

Jump to

Keyboard shortcuts

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