utils

package
v1.0.22 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNamespaceIfNotExist

func CreateNamespaceIfNotExist(runtimeClient client.Client, ctx context.Context, logger logr.Logger, namespace string) error

CreateNamespaceIfNotExist checks if provided namespace exists, and creates it if it does not exist.

func GetIdentifier

func GetIdentifier(o k8s.Object) string

GetIdentifier returns the supplied resource's kind, group, name, and (if any) namespace.

func GetOperatorImage

func GetOperatorImage(ctx context.Context, k8sClient client.Client) (string, error)

GetOperatorImage returns the image used by the operator.

func MustLabelSelector added in v1.0.17

func MustLabelSelector(key string, operator selection.Operator, values []string) client.MatchingLabelsSelector

MustLabelSelector creates a new label selector with the given key, operator, and values panics if any of the values are invalid

func PointSlice

func PointSlice[T any](slice []T) []*T

PointSlice converts a slice of values to a slice of pointers to those values.

func WaitForDeploymentReady

func WaitForDeploymentReady(ctx context.Context, log logr.Logger, runtimeClient client.Client, name, namespace string) error

WaitForDeploymentReady waits for a deployment to be ready by checking: * if the available replicas match the desired replicas * if the deployment has the Available condition set to true

func WaitForSecret

func WaitForSecret(ctx context.Context, runtimeClient client.Client, secretName string, namespace string) error

WaitForSecret waits for provided Secret to be created

Types

This section is empty.

Jump to

Keyboard shortcuts

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