Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsPodAvailable ¶
func IsPodAvailable(pod *corev1.Pod, minReadySeconds int32, now metav1.Time) bool
IsPodAvailable returns true if a pod is available; false otherwise. Precondition for an available pod is that it must be ready. On top of that, there are two cases when a pod can be considered available: 1. minReadySeconds == 0, or 2. LastTransitionTime (is set) + minReadySeconds < current time
func IsPodReady ¶
func IsPodReady(pod *corev1.Pod) bool
IsPodReady returns true if a pod is ready; false otherwise.
func VisitContainers ¶ added in v0.27.0
func VisitContainers(podSpec *corev1.PodSpec, mask ContainerType, visitor ContainerVisitor) bool
VisitContainers invokes the visitor function with a pointer to every container spec in the given pod spec with type set in mask. If visitor returns false, visiting is short-circuited. VisitContainers returns true if visiting completes, false if visiting was short-circuited.
Types ¶
type ActivePods ¶
type ActivePods []*corev1.Pod
ActivePods type allows custom sorting of pods so a controller can pick the best ones to delete.
type ByLogging ¶
type ByLogging []*corev1.Pod
ByLogging allows custom sorting of pods so the best one can be picked for getting its logs.
type ContainerType ¶ added in v0.27.0
type ContainerType int
ContainerType signifies container type
const (
// Containers is for normal containers
Containers ContainerType = 1 << iota
// InitContainers is for init containers
InitContainers
// EphemeralContainers is for ephemeral containers
EphemeralContainers
)
const AllContainers ContainerType = (InitContainers | Containers | EphemeralContainers)
AllContainers specifies that all containers be visited.
type ContainerVisitor ¶ added in v0.27.0
type ContainerVisitor func(container *corev1.Container, containerType ContainerType) (shouldContinue bool)
ContainerVisitor is called with each container spec, and returns true if visiting should continue.