testing

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package testing contains test helpers for reconcilers.

Heavily based on Knative's tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFactory

func MakeFactory(ctor Ctor, unstructured bool, logger *zap.SugaredLogger) rt.Factory

MakeFactory creates a testing factory for our controller.Reconciler, and initializes a Reconciler using the given Ctor as part of the process.

func NewScheme

func NewScheme() *runtime.Scheme

NewScheme returns a new scheme populated with the types defined in clientSetSchemes.

func ToUnstructured

func ToUnstructured(t *testing.T, 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
}

Listers returns listers and objects filtered from those listers.

func NewListers

func NewListers(objs []runtime.Object) Listers

NewListers returns a new instance of Listers initialized with the given objects.

func (*Listers) GetConfigMapLister added in v1.5.3

func (l *Listers) GetConfigMapLister() corev1listers.ConfigMapLister

GetConfigMapLister returns a lister for ConfigMap objects.

func (*Listers) GetDeploymentLister

func (l *Listers) GetDeploymentLister() appsv1listers.DeploymentLister

GetDeploymentLister returns a lister for Deployment objects.

func (*Listers) GetEndpointsLister

func (l *Listers) GetEndpointsLister() corev1listers.EndpointsLister

GetEndpointsLister returns a lister for Endpoint objects.

func (*Listers) GetKubeObjects

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

GetKubeObjects returns objects from Kubernetes APIs.

func (*Listers) GetMemoryBrokerLister

func (l *Listers) GetMemoryBrokerLister() eventinglistersv1alpha1.MemoryBrokerLister

GetMemoryBrokerLister returns a Lister for MemoryBroker objects.

func (*Listers) GetPodLister

func (l *Listers) GetPodLister() corev1listers.PodLister

GetPodLister returns a lister for Pod objects.

func (*Listers) GetRedisBrokerLister

func (l *Listers) GetRedisBrokerLister() eventinglistersv1alpha1.RedisBrokerLister

GetRedisBrokerLister returns a Lister for RedisBroker objects.

func (*Listers) GetRoleBindingLister

func (l *Listers) GetRoleBindingLister() rbacv1listers.RoleBindingLister

GetRoleBindingLister returns a lister for RoleBinding objects.

func (*Listers) GetSecretLister

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

GetSecretLister returns a lister for Secret objects.

func (*Listers) GetServiceAccountLister

func (l *Listers) GetServiceAccountLister() corev1listers.ServiceAccountLister

GetServiceAccountLister returns a lister for ServiceAccount objects.

func (*Listers) GetServiceLister

func (l *Listers) GetServiceLister() corev1listers.ServiceLister

GetServiceLister returns a lister for Service objects.

func (*Listers) GetTriggerLister

func (l *Listers) GetTriggerLister() eventinglistersv1alpha1.TriggerLister

GetTriggerLister returns a Lister for Trigger objects.

func (*Listers) GetTriggerMeshObjects

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

GetTriggerMeshObjects returns objects from TriggerMesh APIs.

func (*Listers) IndexerFor

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

IndexerFor returns the indexer for the given object.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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