utils

package
v0.0.0-...-2c0259d Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: EPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMap

func AddMap(a map[string]string, b map[string]string)

func CloneMap

func CloneMap(m map[string]string) map[string]string

func ComputeHash256

func ComputeHash256(data []byte) string

func Contains

func Contains(list []string, s string) bool

func FindAvailableDelimiter

func FindAvailableDelimiter(s string) string

FindAvailableDelimiter returns the first delimiter from a predefined list (comma, pipe, semicolon, colon, hash, tab) that is not present in the given string. This is useful for selecting a safe separator character when joining values that may themselves contain common delimiters. Returns an empty string if all candidate delimiters are already present in the input.

func FormatLabels

func FormatLabels(m map[string]string) string

Converts label map into plain string

func GeneratePassword

func GeneratePassword(stringLength int) (passwd string)

func GetArchitectureDependentEnvName

func GetArchitectureDependentEnvName(name string) string

GetArchitectureDependentEnvName returns environment variable name dependending on architecture by adding "_<ARCHITECTURE>" suffix. If variable is not set then the default will be return.

func GetEnvByName

func GetEnvByName(name string, envs []corev1.EnvVar) string

func GetEnvsByRegExp

func GetEnvsByRegExp(regExp string) []corev1.EnvVar

func GetGetArchitectureDependentEnvsByRegExp

func GetGetArchitectureDependentEnvsByRegExp(regExp string) []corev1.EnvVar

func GetImageNameAndTag

func GetImageNameAndTag(image string) (string, string)

GetImageNameAndTag returns the image repository and tag name from the provided image Referenced from https://github.com/che-incubator/chectl/blob/main/src/util.ts

func GetMapOrDefault

func GetMapOrDefault(value map[string]string, defaultValue map[string]string) map[string]string

func GetPullPolicyFromDockerImage

func GetPullPolicyFromDockerImage(dockerImage string) string

func GetValue

func GetValue(value string, defaultValue string) string

func InNamespaceEventFilter

func InNamespaceEventFilter(namespace string) predicate.Predicate

func IndexEnv

func IndexEnv(name string, envs []corev1.EnvVar) int

func MergeMaps

func MergeMaps(maps []map[string]string) map[string]string

MergeMaps merges maps into a single one. If a key is present in multiple maps, the value from the last map is used.

func ParseMap

func ParseMap(src string) map[string]string

func ReadObjectInto

func ReadObjectInto(yamlFile string, obj interface{}) error

func Remove

func Remove(list []string, s string) []string

func Whitelist

func Whitelist(hostname string) (value string)

Whitelists the host. Sample: Whitelist("che.yourcompany.com") -> ".yourcompany.com"

Types

This section is empty.

Jump to

Keyboard shortcuts

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