testing

package
v0.0.0-...-a52e8f6 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFactory

func MakeFactory(ctor Ctor) rt.Factory

MakeFactory creates a reconciler factory with fake clients and controller created by the given Ctor.

func NewConfigMap

func NewConfigMap(ns, name string, opts ...ConfigMapOption) *corev1.ConfigMap

NewConfigMap creates a ConfigMap object.

func NewScheme

func NewScheme() *runtime.Scheme

func SetEnvVar

func SetEnvVar(t *testing.T, name, val string) (unset func())

SetEnvVar sets the value of an env var and returns a function that can be deferred to unset that variable.

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 ConfigMapOption

type ConfigMapOption func(*corev1.ConfigMap)

ConfigMapOption is a functional option for ConfigMap objects.

func WithData

func WithData(data map[string]string) ConfigMapOption

WithData sets the data of a ConfigMap.

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(scheme *runtime.Scheme, objs []runtime.Object) Listers

func (*Listers) GetChannelLister

func (l *Listers) GetChannelLister() messaginglistersv1alpha1.ChannelLister

func (*Listers) GetEventingObjects

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

func (*Listers) GetHTTPSourceLister

func (l *Listers) GetHTTPSourceLister() sourceslistersv1alpha1.HTTPSourceLister

func (*Listers) GetServiceLister

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

func (*Listers) GetServingObjects

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

func (*Listers) GetSourcesObjects

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

func (*Listers) IndexerFor

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

IndexerFor returns the indexer for the given object.

Jump to

Keyboard shortcuts

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