helper

package
v0.10.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	APIServerLocalCertPath = "apiserver.local.config"
)

Variables

View Source
var (
	WatchTimeoutSeconds int64 = 240
)

Functions

func BuilderClient

func BuilderClient(t *testing.T, project string) client.Client

func ClientAndProject

func ClientAndProject(t *testing.T) (client.Client, *v1.ProjectInstance)

func EnableFeatureWithRestore added in v0.9.0

func EnableFeatureWithRestore(t *testing.T, ctx context.Context, kclient kclient.WithWatch, feature string)

func EncryptData

func EncryptData(t *testing.T, client client.Client, keys []string, data string) string

func EnsureCRDs

func EnsureCRDs(t *testing.T)

func EnsureDoesNotExist

func EnsureDoesNotExist(ctx context.Context, getter func() (client.Object, error)) error

func GetCTX

func GetCTX(t *testing.T) context.Context

func GetEncryptionKeys

func GetEncryptionKeys(t *testing.T, clients []client.Client) []string

func Must

func Must(err error)

func MustReturn

func MustReturn[T any](f func() (T, error)) T

func SetIgnoreResourceRequirementsWithRestore added in v0.10.0

func SetIgnoreResourceRequirementsWithRestore(t *testing.T, ctx context.Context, kclient kclient.WithWatch)

func StartAPI

func StartAPI(t *testing.T) *rest.Config

func StartController

func StartController(t *testing.T)

func StartRegistry

func StartRegistry(t *testing.T) (string, func())

func Subset

func Subset[V, W any, Z comparable](t *testing.T, first []V, second []W, firstLookup func(V) Z, secondLookup func(W) Z) bool

Subset returns true if the first array is completely contained in the second array. There must be at least the same number of duplicate values in second as there are in first.

func TempProject

func TempProject(t *testing.T, client client.WithWatch) *v1.ProjectInstance

func Wait

func Wait[T client.Object](t *testing.T, watchFunc WatchFunc, list client.ObjectList, cb func(obj T) bool) T

func WaitForObject

func WaitForObject[T client.Object](t *testing.T, watchFunc WatchFunc, list client.ObjectList, obj T, cb func(obj T) bool) T

Types

type WatchFunc

type WatchFunc func(ctx context.Context, obj client.ObjectList, opts ...client.ListOption) (watch.Interface, error)

func Watcher

func Watcher(t *testing.T, c hclient.Client) WatchFunc

Jump to

Keyboard shortcuts

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