Documentation ¶
Index ¶
- func ChangedAfter(obj client.Object, mutateFn func() error) bool
- func ConfigMapVolume(name string) corev1.VolumeSource
- func EnvVarKey(v corev1.EnvVar) string
- func FieldRefEnv(key string, field string) corev1.EnvVar
- func FindFirst[E any](list []E, predicate Predicate[E]) *E
- func GetContainersReadyCondition(status v1.PodStatus) *v1.PodCondition
- func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
- func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
- func Ignore(isErr func(error) bool, err error) error
- func IsContainersReadyConditionTrue(status v1.PodStatus) bool
- func IsFound(err error) (error, bool)
- func IsPodAvailable(pod *v1.Pod, minReadySeconds int32, now metav1.Time) bool
- func IsPodPhaseTerminal(phase v1.PodPhase) bool
- func IsPodReady(pod *v1.Pod) bool
- func IsPodReadyConditionTrue(status v1.PodStatus) bool
- func IsPodTerminal(pod *v1.Pod) bool
- func PodOrdinal(name string) (int, error)
- func Upsert[E comparable](list []E, elem E) []E
- func UpsertByKey[K comparable, V any](list []V, elem V, keyFunc func(V) K) []V
- func WasDeleted(obj client.Object) bool
- type Predicate
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigMapVolume ¶
func ConfigMapVolume(name string) corev1.VolumeSource
func GetContainersReadyCondition ¶
func GetContainersReadyCondition(status v1.PodStatus) *v1.PodCondition
GetContainersReadyCondition extracts the containers ready condition from the given status and returns that. Returns nil if the condition is not present.
func GetPodCondition ¶
func GetPodCondition(status *v1.PodStatus, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodCondition extracts the provided condition from the given status and returns that. Returns nil and -1 if the condition is not present, and the index of the located condition.
func GetPodConditionFromList ¶
func GetPodConditionFromList(conditions []v1.PodCondition, conditionType v1.PodConditionType) (int, *v1.PodCondition)
GetPodConditionFromList extracts the provided condition from the given list of condition and returns the index of the condition and the condition. Returns -1 and nil if the condition is not present.
func GetPodReadyCondition ¶
func GetPodReadyCondition(status v1.PodStatus) *v1.PodCondition
GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.
func IsContainersReadyConditionTrue ¶
IsContainersReadyConditionTrue returns true if a pod is ready; false otherwise.
func IsPodAvailable ¶
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 IsPodPhaseTerminal ¶
IsPhaseTerminal returns true if the pod's phase is terminal.
func IsPodReady ¶
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
func IsPodTerminal ¶
IsPodTerminal returns true if a pod is terminal, all containers are stopped and cannot ever regress.
func PodOrdinal ¶
func Upsert ¶
func Upsert[E comparable](list []E, elem E) []E
func UpsertByKey ¶
func UpsertByKey[K comparable, V any](list []V, elem V, keyFunc func(V) K) []V
UpsertByKey insert an element to the list or update an existing element in list with same key. UpsertByKey assumes the no duplicate key and will only update the first element with the same key if there are duplicate keys in the list.