testing

package
v0.0.0-...-031e5ed Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2021 License: Apache-2.0 Imports: 37 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) GetAppsObjects

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

func (*Listers) GetChannelLister

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

func (*Listers) GetCoreObjects

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

func (*Listers) GetDeploymentLister

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

func (*Listers) GetEventingObjects

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

func (*Listers) GetHTTPSourceLister

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

func (*Listers) GetIstioObjects

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

func (*Listers) GetLegacyObjects

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

func (*Listers) GetPeerAuthenticationLister

func (l *Listers) GetPeerAuthenticationLister() securitylistersv1alpha1.PeerAuthenticationLister

func (*Listers) GetServiceLister

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

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