utils

package
v0.0.0-...-dcfb068 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConstructNominatedNode

func ConstructNominatedNode(nominatedNodeName string, victims *framework.Victims) *framework.NominatedNode

func CreateScheduleUnit

CreateScheduleUnit create a unit object from the pod.

func GetEarliestPodStartTime

func GetEarliestPodStartTime(victims *framework.Victims) *metav1.Time

GetEarliestPodStartTime returns the earliest start time of all pods that have the highest priority among all victims.

func GetNodeNameFromPod

func GetNodeNameFromPod(pod *v1.Pod) string

GetNodeNameFromPod returns the name of node where pod is assumed to be placed on, based on following rules: 1. NodeName should be Pod.Spec.NodeName if Pod.Spec.NodeName is set 2. NodeName should be Pod.Annotations[AssumedNodeAnnotationKey] if Pod.Annotations[AssumedNodeAnnotationKey] is set 3. NodeName should be Pod.Annotations[NominatedNodeAnnotationKey] if Pod.Annotations[NominatedNodeAnnotationKey] is set 4. NodeName should be ""

func GetPodNominatedNode

func GetPodNominatedNode(pod *v1.Pod) (*framework.NominatedNode, error)

func GetPotentialVictims

func GetPotentialVictims(pod *v1.Pod) (*framework.PotentialVictims, error)

GetPotentialVictims return potential victims of the given pod, from annotation potentialVictims

func GetUnitIdentifier

func GetUnitIdentifier(pod *v1.Pod) string

GetUnitIdentifier return id of the unit.

func GetUnitType

func GetUnitType(pod *v1.Pod) framework.ScheduleUnitType

GetUnitType return unit type of the pod. This method assumes pod belongs to unit

func PodBelongToUnit

func PodBelongToUnit(pod *v1.Pod) bool

PodBelongToUnit check whether or not pod belongs to unit.

func SchedSleep

func SchedSleep(duration time.Duration)

SchedSleep help to reduce the failures caused by golang scheduler which cannot schedule goroutines fast enough during unittests when coverage is enabled.

func SetPodNominatedNode

func SetPodNominatedNode(pod *v1.Pod, nominatedNode *framework.NominatedNode) error

SetPodNominatedNode nominatedNode is supposed to be checked before call SetPodNominatedNode

Types

This section is empty.

Jump to

Keyboard shortcuts

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