utils

package
v0.0.0-...-d01df85 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckFileExistsInDir

func CheckFileExistsInDir(rootDir, filename string) (bool, error)

func CheckIfEnvironmentExists

func CheckIfEnvironmentExists(env string) bool

CheckIfEnvironmentExists return true/false if the environment variable exists

func CheckOptions

func CheckOptions(optionsArr []Options) (bool, error)

check options are valid or not

func Contains

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

contains checks if a string is present in a slice

func CreateDir

func CreateDir(target string) error

func CreateDockerConfigFile

func CreateDockerConfigFile(base64EncodedString string) error

CreateDockerConfigFile takes base64 encoded dockerconfig.json and saves it locally (/<home-directory/.docker/config.json)

func CreateFile

func CreateFile(target string, header *tar.Header, tr *tar.Reader) error

func CreateKubeconfigFileForRestConfig

func CreateKubeconfigFileForRestConfig(restConfig rest.Config) ([]byte, error)

Build a kubeconfig string from an existing client config

func ExecuteCommandInASpecificDirectory

func ExecuteCommandInASpecificDirectory(command string, args []string, directory string) error

func ExtractGitRepositoryNameFromURL

func ExtractGitRepositoryNameFromURL(url string) (name string)

func FilterSliceUsingPattern

func FilterSliceUsingPattern(pattern string, lString []string) []string

func GetAdditionalInfo

func GetAdditionalInfo(applicationName, namespace string) string

GetAdditionalInfo adds information regarding the application name and namespace of the test

func GetChangedFiles

func GetChangedFiles(repo string) (rulesengine.Files, error)

func GetContainerLogs

func GetContainerLogs(ki kubernetes.Interface, podName, containerName, namespace string) (string, error)

Return a container logs from a given pod and namespace

func GetEnv

func GetEnv(key, defaultVal string) string

Retrieve an environment variable. If will not exists will be used a default value

func GetEnvOrFunc

func GetEnvOrFunc(key string, defaultFunc func() (string, error)) (string, error)

Retrieve an environment variable. If it doesn't exist, returns result of a call to `defaultFunc`.

func GetFileNamesFromDir

func GetFileNamesFromDir(dirPath string) ([]string, error)

func GetGeneratedNamespace

func GetGeneratedNamespace(name string) string

func GetGithubAppID

func GetGithubAppID() (int64, error)

func GetOpenshiftToken

func GetOpenshiftToken() (token string, err error)

func GetQuayIOOrganization

func GetQuayIOOrganization() string

func GetRepoName

func GetRepoName(repoUrl string) string

func IsPrivateHostname

func IsPrivateHostname(url string) bool

func MergeMaps

func MergeMaps(m1, m2 map[string]string) map[string]string

func ReadTarFile

func ReadTarFile(tarPath string) (*tar.Reader, error)

func ToPrettyJSONString

func ToPrettyJSONString(v interface{}) string

func Untar

func Untar(dst string, tarPath string) error

func WaitUntil

func WaitUntil(cond wait.ConditionFunc, timeout time.Duration) error

func WaitUntilWithInterval

func WaitUntilWithInterval(cond wait.ConditionFunc, interval time.Duration, timeout time.Duration) error

Types

type Options

type Options struct {
	ToolchainApiUrl string
	KeycloakUrl     string
	OfflineToken    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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