Documentation ¶
Index ¶
- Constants
- func AddFinalizer(ctx context.Context, c client.Client, obj client.Object, finalizer string) error
- func AggregateErrors(errs []error) error
- func BeforeReady(po *corev1.Pod) bool
- func ContainsFinalizer(obj client.Object, finalizer string) bool
- func FormatTime(originTime metav1.Time) metav1.Time
- func FormatTimeNow() metav1.Time
- func GetLabelAnnoPatchBytes(oldLabels, newLabels, oldAnno, newAnno map[string]string) []byte
- func GetPodCondition(status *corev1.PodStatus, conditionType corev1.PodConditionType) (int, *corev1.PodCondition)
- func GetPodConditionFromList(conditions []corev1.PodCondition, conditionType corev1.PodConditionType) (int, *corev1.PodCondition)
- func GetPodReadyCondition(status corev1.PodStatus) *corev1.PodCondition
- func GetPodScheduledCondition(status corev1.PodStatus) *corev1.PodCondition
- func GetProtectionFinalizers(pod *corev1.Pod) []string
- func IsExpectedFinalizerSatisfied(pod *corev1.Pod) (bool, map[string]string, error)
- func IsPodPhaseTerminal(phase corev1.PodPhase) bool
- func IsPodReady(pod *corev1.Pod) bool
- func IsPodReadyConditionTrue(status corev1.PodStatus) bool
- func IsPodScheduled(pod *corev1.Pod) bool
- func IsPodScheduledConditionTrue(status corev1.PodStatus) bool
- func IsPodServiceAvailable(pod *corev1.Pod) bool
- func IsPodTerminal(pod *corev1.Pod) bool
- func PodAvailableConditions(pod *corev1.Pod) (*v1alpha1.PodAvailableConditions, error)
- func RemoveFinalizer(ctx context.Context, c client.Client, obj client.Object, finalizer string) error
- func Selected(selector *metav1.LabelSelector, lb map[string]string) bool
- func SlowStartBatch(count int, initialBatchSize int, shortCircuit bool, fn func(int, error) error) (int, error)
Constants ¶
const (
SlowStartInitialBatchSize = 1
)
Variables ¶
This section is empty.
Functions ¶
func AddFinalizer ¶
func AggregateErrors ¶
func BeforeReady ¶
func FormatTimeNow ¶
func GetLabelAnnoPatchBytes ¶
func GetPodCondition ¶
func GetPodCondition(status *corev1.PodStatus, conditionType corev1.PodConditionType) (int, *corev1.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 []corev1.PodCondition, conditionType corev1.PodConditionType) (int, *corev1.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 corev1.PodStatus) *corev1.PodCondition
GetPodReadyCondition extracts the pod ready condition from the given status and returns that. Returns nil if the condition is not present.
func GetPodScheduledCondition ¶
func GetPodScheduledCondition(status corev1.PodStatus) *corev1.PodCondition
func GetProtectionFinalizers ¶
func IsPodPhaseTerminal ¶
IsPodPhaseTerminal 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 IsPodScheduled ¶
func IsPodServiceAvailable ¶
func IsPodTerminal ¶
IsPodTerminal returns true if a pod is terminal, all containers are stopped and cannot ever regress.
func PodAvailableConditions ¶
func PodAvailableConditions(pod *corev1.Pod) (*v1alpha1.PodAvailableConditions, error)
func RemoveFinalizer ¶
func SlowStartBatch ¶
func SlowStartBatch(count int, initialBatchSize int, shortCircuit bool, fn func(int, error) error) (int, error)
SlowStartBatch tries to call the provided function a total of 'count' times, starting slow to check for errors, then speeding up if calls succeed.
It groups the calls into batches, starting with a group of initialBatchSize. Within each batch, it may call the function multiple times concurrently.
If a whole batch succeeds, the next batch may get exponentially larger. If there are any failures in a batch, all remaining batches are skipped after waiting for the current batch to complete.
It returns the number of successful calls to the function.
Types ¶
This section is empty.