util

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DNS1035

func DNS1035(str string) string

func GetConfigMapFromVolume

func GetConfigMapFromVolume(selector *corev1.ConfigMapKeySelector) (string, error)

GetConfigMapFromVolume retrieves the value of mounted config map volume "/var/kyno/config/${configMapRef.name}/${configMapRef.key}" is expected to be the file path

func GetConfigMapVolumePath

func GetConfigMapVolumePath(selector *corev1.ConfigMapKeySelector) (string, error)

GetConfigMapVolumePath returns the path of the mounted configmap

func GetSecretFromVolume

func GetSecretFromVolume(selector *corev1.SecretKeySelector) (string, error)

GetSecretFromVolume retrieves the value of mounted secret volume "/var/kyno/secrets/${secretRef.name}/${secretRef.key}" is expected to be the file path

func GetSecretVolumePath

func GetSecretVolumePath(selector *corev1.SecretKeySelector) (string, error)

GetSecretVolumePath returns the path of the mounted secret

func Hashcode

func Hashcode(str string) int

Hashcode returns a unique hashcode of a string.

func K8sRestConfig

func K8sRestConfig() (*rest.Config, error)

K8sRestConfig returns a rest config for the kubernetes cluster.

func LookupEnvBoolOr

func LookupEnvBoolOr(key string, defaultValue bool) bool

func LookupEnvIntOr

func LookupEnvIntOr(key string, defaultValue int) int

func LookupEnvStringOr

func LookupEnvStringOr(key, defaultValue string) string

func MustHash

func MustHash(v any) string

func MustJSON

func MustJSON(in any) string

func MustUnJSON

func MustUnJSON(v any, in any)

MustUnJSON unmarshalls JSON or panics. v - must be []byte or string in - must be a pointer.

func RandomLowerCaseString

func RandomLowerCaseString(length int) string

func RandomString

func RandomString(length int) string

RandomString generate a random string with given length

func VolumesFromSecretsAndConfigMaps

func VolumesFromSecretsAndConfigMaps(obj interface{}) ([]corev1.Volume, []corev1.VolumeMount)

VolumesFromSecretsAndConfigMaps builds volumes and volumeMounts spec based on the obj and its children's secretKeySelector and configMapKeySelector

Types

This section is empty.

Jump to

Keyboard shortcuts

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