utils

package
v0.0.0-...-be4e7bc Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: EPL-2.0 Imports: 17 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 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 GetMap

func GetMap(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 IsK8SResourceServed

func IsK8SResourceServed(discoveryClient discovery.DiscoveryInterface, resourceName string) bool

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