utils

package
v0.0.0-...-bb4a99d Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PodReasonEvicted is set inside the status as the Pod failure reason
	// when the Kubelet evicts a Pod
	PodReasonEvicted = "Evicted"
)

Variables

This section is empty.

Functions

func CompareEnv

func CompareEnv(c1, c2 corev1.Container) bool

func CompareMap

func CompareMap(exists map[string]string, new map[string]string) bool

func ComparePVC

func ComparePVC(vc1, vc2 corev1.PersistentVolumeClaim) bool

func CompareServicePorts

func CompareServicePorts(p1, p2 []corev1.ServicePort) bool

func ConvertBool

func ConvertBool(flag bool) string

func CountJobsWithOneCompletion

func CountJobsWithOneCompletion(jobList []batchv1.Job) int

CountJobsWithOneCompletion count the number complete jobs

func CountReadyPods

func CountReadyPods(podList []corev1.Pod) int

CountReadyPods counts the number of Pods which are ready

func FilterActivePods

func FilterActivePods(pods []corev1.Pod) []corev1.Pod

FilterActivePods returns pods that have not terminated.

func FilterJobsWithOneCompletion

func FilterJobsWithOneCompletion(jobList []batchv1.Job) []batchv1.Job

FilterJobsWithOneCompletion returns jobs that have one completion

func Find

func Find[T comparable](s []T, cb func(e T) bool) *T

func IsPodActive

func IsPodActive(p corev1.Pod) bool

IsPodActive checks if a pod is active, copied from: https://github.com/kubernetes/kubernetes/blob/1bd0077/test/e2e/framework/pod/resource.go#L664

func IsPodAlive

func IsPodAlive(p corev1.Pod) bool

IsPodAlive check if a pod is active and not crash-looping

func IsPodEvicted

func IsPodEvicted(p *corev1.Pod) bool

IsPodEvicted checks if a pod has been evicted by the Kubelet

func IsPodReady

func IsPodReady(pod corev1.Pod) bool

IsPodReady check if a Pod is ready or not

func IsPodRestart

func IsPodRestart(pod corev1.Pod) bool

func IsPodUnscheduled

func IsPodUnscheduled(p *corev1.Pod) bool

IsPodUnscheduled check if a Pod is unscheduled

func JobHasOneCompletion

func JobHasOneCompletion(job batchv1.Job) bool

JobHasOneCompletion Completion check if a certain job is complete

func MergeMap

func MergeMap[K comparable, V comparable](m1 map[K]V, m2 ...map[K]V) map[K]V

Types

type PodStatus

type PodStatus string

PodStatus represent the possible status of pods

Jump to

Keyboard shortcuts

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