Documentation ¶
Index ¶
- 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 IsPodReady(pod *corev1.Pod) bool
- func IsPodReadyConditionTrue(status corev1.PodStatus) bool
- func RollingUpdate(ctx context.Context, cl client.Client, stsName, namespace string, ...) error
- func WaitForPodReady(ctx context.Context, cl client.Client, name, namespace string, ...) error
- func WaitUntilAllStsPodsAreReady(ctx context.Context, cl client.Client, stsName, namespace string, ...) error
- type MutateFn
- type PersistFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 IsPodReady ¶
IsPodReady returns true if a pod is ready; false otherwise.
func IsPodReadyConditionTrue ¶
IsPodReadyConditionTrue returns true if a pod is ready; false otherwise.
func RollingUpdate ¶
func WaitForPodReady ¶
func WaitUntilAllStsPodsAreReady ¶
func WaitUntilAllStsPodsAreReady(ctx context.Context, cl client.Client, stsName, namespace string, podUpdateTimeout, podMaxPollingInterval time.Duration) error
WaitUntilAllStsPodsAreReady waits until all pods in the statefulset are in the ready state. The ready state implies all nodes are passing node liveness.
Types ¶
type MutateFn ¶
type MutateFn func() error
MutateFn is a function which mutates the existing object into it's desired state.
type PersistFn ¶
type PersistFn func(context.Context, client.Client, client.Object, MutateFn) (upserted bool, err error)
var DefaultPersister PersistFn = func(ctx context.Context, cl client.Client, obj client.Object, f MutateFn) (upserted bool, err error) { result, err := ctrl.CreateOrUpdate(ctx, cl, obj, func() error { return f() }) return result == ctrlutil.OperationResultCreated || result == ctrlutil.OperationResultUpdated, err }