utils

package
v1.1.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const SystemCriticalPriority = scheduling.SystemCriticalPriority

Variables

This section is empty.

Functions

func GetPodSource

func GetPodSource(pod *corev1.Pod) (string, error)

GetPodSource returns the source of the pod based on the annotation.

func GetPriorityFromPriorityClass

func GetPriorityFromPriorityClass(priorityClassLister schedulingv1.PriorityClassLister, name string) (int32, error)

GetPriorityFromPriorityClass gets priority from the given priority class. If no priority class is provided, it will return SystemCriticalPriority by default.

func GetPriorityValueFromPriorityThreshold

func GetPriorityValueFromPriorityThreshold(priorityClassLister schedulingv1.PriorityClassLister, priorityThreshold *deschedulerconfig.PriorityThreshold) (priority int32, err error)

GetPriorityValueFromPriorityThreshold gets priority from the given PriorityThreshold. It will return SystemCriticalPriority by default.

func GetResourceRequest

func GetResourceRequest(pod *corev1.Pod, resource corev1.ResourceName) int64

GetResourceRequest finds and returns the request value for a specific resource.

func GetResourceRequestQuantity

func GetResourceRequestQuantity(pod *corev1.Pod, resourceName corev1.ResourceName) resource.Quantity

GetResourceRequestQuantity finds and returns the request quantity for a specific resource.

func IsCriticalPriorityPod

func IsCriticalPriorityPod(pod *corev1.Pod) bool

IsCriticalPriorityPod returns true if the pod has critical priority.

func IsDaemonsetPod

func IsDaemonsetPod(ownerRefList []metav1.OwnerReference) bool

IsDaemonsetPod returns true if the pod is a IsDaemonsetPod.

func IsMirrorPod

func IsMirrorPod(pod *corev1.Pod) bool

IsMirrorPod returns true if the pod is a Mirror Pod.

func IsPodTerminating

func IsPodTerminating(pod *corev1.Pod) bool

IsPodTerminating returns true if the pod DeletionTimestamp is set.

func IsPodWithLocalStorage

func IsPodWithLocalStorage(pod *corev1.Pod) bool

IsPodWithLocalStorage returns true if the pod has local storage.

func IsPodWithPVC

func IsPodWithPVC(pod *corev1.Pod) bool

IsPodWithPVC returns true if the pod has claimed a persistent volume.

func IsStaticPod

func IsStaticPod(pod *corev1.Pod) bool

IsStaticPod returns true if the pod is a static pod.

func NodeSelectorsEqual

func NodeSelectorsEqual(n1, n2 *corev1.NodeSelector) bool

func PodMatchNodeSelector

func PodMatchNodeSelector(pod *corev1.Pod, node *corev1.Node) (bool, error)

PodMatchNodeSelector checks if a pod node selector matches the node label.

func TolerationsEqual

func TolerationsEqual(t1, t2 []corev1.Toleration) bool

func TolerationsTolerateTaint

func TolerationsTolerateTaint(tolerations []corev1.Toleration, taint *corev1.Taint) bool

TolerationsTolerateTaint checks if taint is tolerated by any of the tolerations.

func TolerationsTolerateTaintsWithFilter

func TolerationsTolerateTaintsWithFilter(tolerations []corev1.Toleration, taints []corev1.Taint, applyFilter taintsFilterFunc) bool

TolerationsTolerateTaintsWithFilter checks if given tolerations tolerates all the taints that apply to the filter in given taint list.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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