util

package
v0.0.0-...-dcd68f7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdRunner

func CmdRunner(program string, args ...string) *gexec.Session

func CmdShouldFail

func CmdShouldFail(program string, args ...string) string

CmdShouldFail returns stderr if command fails

func CmdShouldFailWithRetry

func CmdShouldFailWithRetry(maxRetry, intervalSeconds int, program string, args ...string) string

CmdShouldFailWithRetry runs a command and checks if it fails, if it doesn't then it retries

func CmdShouldPass

func CmdShouldPass(program string, args ...string) string

CmdShouldPass returns stdout if command succeeds

func CmdShouldPassIncludeErrStream

func CmdShouldPassIncludeErrStream(program string, args ...string) (string, string)

CmdShouldPassIncludeErrStream returns stdout and stderr if command succeeds

func CmdShouldRunAndTerminate

func CmdShouldRunAndTerminate(timeoutAfter time.Duration, stopChan <-chan bool, program string, args ...string) string

CmdShouldRunAndTerminate waits and returns stdout after a closed signal is passed on the closed channel

func CmdShouldRunWithTimeout

func CmdShouldRunWithTimeout(timeout time.Duration, program string, args ...string) string

CmdShouldRunWithTimeout waits for a certain duration and then returns stdout

func GetRegistryIndex

func GetRegistryIndex(url string) []indexSchema.Schema

GetRegistryIndex downloads the registry index.json at the specified URL and returns it

func ProbeRegistry

func ProbeRegistry(registryUrl string, timeout int) error

Probes a devfile registry to check if ready

func WaitAndCheckForTerminatingState

func WaitAndCheckForTerminatingState(path, resourceType, namespace string, timeoutMinutes int) bool

WaitAndCheckForTerminatingState waits for the given interval and checks if the given resource type has been deleted on the cluster or is in the terminating state path is the path to the program's binary

func WaitForOutputToContain

func WaitForOutputToContain(substring string, timeoutInSeconds int, intervalInSeconds int, session *gexec.Session)

WaitForOutputToContain waits for for the session stdout output to contain a particular substring

Types

type CmdWrapper

type CmdWrapper struct {
	Cmd *exec.Cmd
	// contains filtered or unexported fields
}

func Cmd

func Cmd(program string, args ...string) *CmdWrapper

func (*CmdWrapper) Out

func (cw *CmdWrapper) Out() string

func (*CmdWrapper) OutAndErr

func (cw *CmdWrapper) OutAndErr() (string, string)

func (*CmdWrapper) ShouldPass

func (cw *CmdWrapper) ShouldPass() *CmdWrapper

func (*CmdWrapper) WithEnv

func (cw *CmdWrapper) WithEnv(args ...string) *CmdWrapper

type OCICatalog

type OCICatalog struct {
	Repositories []string `json:"repositories,omitempty"`
}

Jump to

Keyboard shortcuts

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