util

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanString

func CleanString(s string) string

CleanString cleans up a string by removing leading and trailing newlines, and helps with using backticks in multi-line strings by replacing triple single quotes with backticks.

func GetK8sClientConfig

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

GetK8sClientConfig creates a Kubernetes client config using the default loading rules.

func GetK8sClientConfigWithContext

func GetK8sClientConfigWithContext(kubeContext string) (*rest.Config, error)

GetK8sClientConfigWithContext creates a Kubernetes client config using the specified context.

func GetTestEnvOptionalVar

func GetTestEnvOptionalVar(t testing.TB, modulePkg, key string) string

GetTestEnvOptionalVar retrieves an optional environment variable for tests.

func GetTestEnvRequiredVar

func GetTestEnvRequiredVar(t testing.TB, modulePkg, key string) string

GetTestEnvRequiredVar retrieves a required environment variable for tests. If the variable is not set, the test is skipped.

func RandomPassword

func RandomPassword(length int) string

RandomPassword generates a random password of the given length.

func RequirePrng added in v0.2.0

func RequirePrng()

RequirePrng ensures that the system has a secure PRNG available for the crypto/rand package.

Types

This section is empty.

Jump to

Keyboard shortcuts

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