testing

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TrackerKey key = struct{}{}

TrackerKey is used to looking a FakeTracker in a context.Context

Functions

func AssertTrackingObject

func AssertTrackingObject(gvk schema.GroupVersionKind, namespace, name string) func(*testing.T, *rtesting.TableRow)

AssertTrackingObject will ensure the following objects are being tracked

func AssertTrackingProvisionedService

func AssertTrackingProvisionedService(namespace, name string) func(*testing.T, *rtesting.TableRow)

AssertTrackingProvsisionedService will ensure the provided ProvisionedService is being tracked

func AssertTrackingSecret

func AssertTrackingSecret(namespace, name string) func(*testing.T, *rtesting.TableRow)

AssertTrackingSecret will ensure the provided Secret is being tracked

func GetTracker

func GetTracker(ctx context.Context) tracker.Interface

func MakeFactory

func MakeFactory(ctor Ctor) rtesting.Factory

MakeFactory creates a reconciler factory with fake clients and controller created by `ctor`.

func NewScheme

func NewScheme() *runtime.Scheme

func ToUnstructured

func ToUnstructured(t *testing.T, sch *runtime.Scheme, objs []runtime.Object) (us []runtime.Object)

ToUnstructured takes a list of k8s resources and converts them to Unstructured objects. We must pass objects as Unstructured to the dynamic client fake, or it won't handle them properly.

Types

type Ctor

Ctor functions create a k8s controller with given params.

type Listers

type Listers struct {
	// contains filtered or unexported fields
}

func NewListers

func NewListers(objs []runtime.Object) Listers

func (*Listers) GetKubeObjects

func (l *Listers) GetKubeObjects() []runtime.Object

func (*Listers) GetNamespaceLister

func (l *Listers) GetNamespaceLister() corev1listers.NamespaceLister

func (*Listers) GetProvisionedServiceLister

func (l *Listers) GetProvisionedServiceLister() labslisters.ProvisionedServiceLister

func (*Listers) GetSecretLister

func (l *Listers) GetSecretLister() corev1listers.SecretLister

func (*Listers) GetServiceBindingLister

func (l *Listers) GetServiceBindingLister() servicebindinglisters.ServiceBindingLister

func (*Listers) GetServiceBindingProjectionLister

func (l *Listers) GetServiceBindingProjectionLister() labsinternallisters.ServiceBindingProjectionLister

func (*Listers) GetServiceBindingsObjects

func (l *Listers) GetServiceBindingsObjects() []runtime.Object

func (*Listers) IndexerFor

func (l *Listers) IndexerFor(obj runtime.Object) cache.Indexer

func (*Listers) NewScheme

func (*Listers) NewScheme() *runtime.Scheme

Jump to

Keyboard shortcuts

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