helper

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 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, namespace string) client.Client

func ClientAndNamespace

func ClientAndNamespace(t *testing.T) (client.Client, *corev1.Namespace)

func EncryptData added in v0.3.0

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 added in v0.3.0

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 NamedTempProject added in v0.6.0

func NamedTempProject(t *testing.T, client client.Client, name string) *corev1.Namespace

func NamespaceClusterRoleAndBinding added in v0.7.0

func NamespaceClusterRoleAndBinding(t *testing.T, ctx context.Context, k8sclient client.Client, namespace string) error

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 added in v0.6.0

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 TempNamespace

func TempNamespace(t *testing.T, client client.Client) *corev1.Namespace

func TempProject added in v0.6.0

func TempProject(t *testing.T, client client.Client) *corev1.Namespace

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 added in v0.5.0

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