utils

package
v0.0.0-...-f7e4497 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: EPL-2.0 Imports: 19 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 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

type Process

type Process struct {
	// contains filtered or unexported fields
}

func (*Process) GetStdErr

func (p *Process) GetStdErr() string

func (*Process) GetStdOut

func (p *Process) GetStdOut() string

func (*Process) Run

func (p *Process) Run(name string, args ...string) error

type Runnable

type Runnable interface {
	Run(name string, args ...string) error
	GetStdOut() string
	GetStdErr() string
}

func NewRunnable

func NewRunnable() Runnable

Jump to

Keyboard shortcuts

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