...

Package testresource

import "github.com/cert-manager/issuer-lib/internal/tests/testresource"
Overview
Index

Overview ▾

type CompleteFunc

type CompleteFunc func(fn func(runtime.Object) error, eventTypes ...watch.EventType) error

type OwnedKubeClients

type OwnedKubeClients struct {
    EnvTest    *envtest.Environment
    Rest       *rest.Config
    Scheme     *runtime.Scheme
    KubeClient *kubernetes.Clientset
    Client     client.WithWatch
}

func KubeClients

func KubeClients(tb testing.TB, kubeconfig *string) *OwnedKubeClients

func (*OwnedKubeClients) InstallCRDs

func (k *OwnedKubeClients) InstallCRDs(options envtest.CRDInstallOptions) ([]*apiextensionsv1.CustomResourceDefinition, error)

func (*OwnedKubeClients) SetupNamespace

func (k *OwnedKubeClients) SetupNamespace(tb testing.TB, ctx context.Context) (string, context.CancelFunc)

func (*OwnedKubeClients) StartObjectWatch

func (k *OwnedKubeClients) StartObjectWatch(
    tb testing.TB,
    ctx context.Context,
    object client.Object,
) CompleteFunc

StartObjectWatch starts a watch for the provided object, the returned function should be used to wait for a condition to succeed. The watch will start after calling this function. This means that the completion function can respond to events received before calling the complete function but after calling StartObjectWatch.