util

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GroupStatefulSetsByLabel

func GroupStatefulSetsByLabel(sets []*v1.StatefulSet, label string) map[string][]*v1.StatefulSet

GroupStatefulSetsByLabel returns a map containing the input StatefulSets grouped by the input label's value.

func IsPodRunningAndReady

func IsPodRunningAndReady(pod *corev1.Pod) bool

IsPodRunningAndReady returns whether the input pod is running and ready.

func MoveStatefulSetToFront

func MoveStatefulSetToFront(sets []*v1.StatefulSet, toMove *v1.StatefulSet) []*v1.StatefulSet

MoveStatefulSetToFront returns a new slice where the input StatefulSet toMove is moved to the beginning. Comparison is done via pointer equality.

func MustNewLabelsRequirement

func MustNewLabelsRequirement(key string, op selection.Operator, vals []string) labels.Requirement

MustNewLabelsRequirement wraps labels.NewRequirement() and panics on error. This utility function can be safely used whenever the input is deterministic (eg. based on hard-coded config).

func Now

func Now() *metav1.Time

func PodNames

func PodNames(pods []*corev1.Pod) []string

PodNames returns the names of input pods.

func SortPods

func SortPods(pods []*corev1.Pod)

SortPods sorts in-place the provided slice of Pod. Pod names are sorted in natural order in order to play nicely with StatefulSet naming schema.

func SortStatefulSets

func SortStatefulSets(sets []*v1.StatefulSet)

SortStatefulSets sorts in-place the provided slice of StatefulSet.

Types

This section is empty.

Jump to

Keyboard shortcuts

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