kci

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddFinalizer

func AddFinalizer(om *metav1.ObjectMeta, item string) *metav1.ObjectMeta

AddFinalizer adds finalizer to object metadata

func BaseLabelBuilder

func BaseLabelBuilder() map[string]string

BaseLabelBuilder builds source label. It will be used as base label for the kubernetes objects which created by db-operator

func BuildEnvVarSource

func BuildEnvVarSource(fieldPath string) *corev1.EnvVarSource

BuildEnvVarSource builds kubernetes a source for the value of an EnvVar

func ConfigMapBuilder

func ConfigMapBuilder(name string, namespace string, data map[string]string, ownership []metav1.OwnerReference) *corev1.ConfigMap

ConfigMapBuilder builds kubernetes configmap object

func GenerateChecksum

func GenerateChecksum(v interface{}) string

GenerateChecksum generates hash value of given interface

func GeneratePass

func GeneratePass() string

GeneratePass generates secure password string

func GetConfigResource

func GetConfigResource(ctx context.Context, key types.NamespacedName) (*corev1.ConfigMap, error)

GetConfigResource get configmap resource by kubernetes incluster rest api TODO: will be deprecated

func GetSecretResource

func GetSecretResource(ctx context.Context, key types.NamespacedName) (*corev1.Secret, error)

GetSecretResource get secret resource by kubernetes incluster rest api TODO: will be deprecated

func LabelBuilder

func LabelBuilder(labels map[string]string) map[string]string

LabelBuilder builds key, value label which can be used for kubernetes object metadata

func RemoveFinalizer

func RemoveFinalizer(om *metav1.ObjectMeta, item string) *metav1.ObjectMeta

RemoveFinalizer removes finalizer from object metadata

func Retry

func Retry(attempts int, intervals time.Duration, fn func() error) error

Retry retries given function for given attempts times with given intervals

func SecretBuilder

func SecretBuilder(secretName string, namespace string, data map[string][]byte, ownership []metav1.OwnerReference) *corev1.Secret

SecretBuilder builds kubernetes secret object

func StringNotEmpty

func StringNotEmpty(values ...string) string

StringNotEmpty return the first not empty string

func StringSanitize

func StringSanitize(s string, limit int) string

StringSanitize sanitizes and truncates a string to a fixed length using a hash function. useful for restricting the length and content of user supplied database identifiers.

func TimeTrack

func TimeTrack(start time.Time) float64

TimeTrack tracks seconds since given start time

Types

This section is empty.

Jump to

Keyboard shortcuts

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