utils

package
v0.0.0-...-45ed318 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertNil

func AssertNil(err error, msg ...interface{})

func Case

func Case(name string, f func())

func DebugSleep

func DebugSleep(t time.Duration)

func FCase

func FCase(name string, f func())

func GetKubeConfig

func GetKubeConfig() string

GetKubeConfig returns the kubeconfig file path. Order: env KUBECONFIG; ~/.kube/config; "" (in case in-cluster configuration will be used).

func IgnorePanic

func IgnorePanic(f func())

func LogTimeElapsed

func LogTimeElapsed(format string) func(duration time.Duration)

func LogTimeTrack

func LogTimeTrack(started time.Time, format string)

func LogTimeTrackSkipFrames

func LogTimeTrackSkipFrames(started time.Time, format string, frames int)

func NewParallelExecutor

func NewParallelExecutor(name string) *parallelExecutor

func ParallelRunAndWait

func ParallelRunAndWait(handlers ...func())

func ParallelRunFunctionsAndWait

func ParallelRunFunctionsAndWait(handlersArray ...[]func())

func PtrOf

func PtrOf[T any](v T) *T

func RandomNamespace

func RandomNamespace() string

func RenderManifest

func RenderManifest(manifest string, data any) (string, error)

func RetryUntilTimeout

func RetryUntilTimeout(condFunc func() (bool, error)) error

TODO: automatically recover assertion failure

func SCase

func SCase(name string, f func())

func TimeTrack

func TimeTrack(started time.Time, handler func(duration time.Duration))

func WaitExponentialBackoff

func WaitExponentialBackoff(condFunc func() (bool, error)) error

func WaitForDeploymentPodsReady

func WaitForDeploymentPodsReady(kubectlOpts *k8s.KubectlOptions, namespace, name string) error

func WaitForServiceReady

func WaitForServiceReady(kubectlOpts *k8s.KubectlOptions, ns, name string) (string, error)

Types

type MultiError

type MultiError []error

func (MultiError) Error

func (multi MultiError) Error() string

Jump to

Keyboard shortcuts

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