testing

package
v0.0.0-...-25e0b32 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFactory

func MakeFactory(ctor Ctor) reconcilertesting.Factory

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

func NewDeployment

func NewDeployment(name, namespace string, do ...DeploymentOption) *appsv1.Deployment

NewDeployment creates a Deployment with DeploymentOptions.

func NewMongoDbSource

func NewMongoDbSource(name, namespace string, o ...MongoDbSourceOption) *v1alpha1.MongoDbSource

NewMongoDbSource creates a MongoDbSource with MongoDbSourceOption.

func WithInitMongoDbSourceConditions

func WithInitMongoDbSourceConditions(s *v1alpha1.MongoDbSource)

WithInitMongoDbSourceConditions initializes the MongoDbSource's conditions.

func WithMongoDbSourceSinkNotFound

func WithMongoDbSourceSinkNotFound(s *v1alpha1.MongoDbSource)

WithMongoDbSourceSinkNotFound updates the status of the sink to be not found.

Types

type Ctor

type Ctor func(context.Context, *Listers, configmap.Watcher, map[string]interface{}) controller.Reconciler

Ctor functions create a k8s controller with given params.

type DeploymentOption

type DeploymentOption func(*appsv1.Deployment)

DeploymentOption enables further configuration of a Deployment.

func WithDeploymentAnnotations

func WithDeploymentAnnotations(annotations map[string]string) DeploymentOption

WithDeploymentAnnotations adds Annotations to the Deployment.

func WithDeploymentAvailable

func WithDeploymentAvailable() DeploymentOption

WithDeploymentAvailable marks the Deployment as available.

func WithDeploymentContainer

func WithDeploymentContainer(name, image string, liveness *corev1.Probe, readiness *corev1.Probe, envVars []corev1.EnvVar, containerPorts []corev1.ContainerPort) DeploymentOption

WithDeploymentContainer adds Container to the Deployment.

func WithDeploymentLabels

func WithDeploymentLabels(labels map[string]string) DeploymentOption

WithDeploymentLabels adds Labels to the Deployment.

func WithDeploymentOwnerReferences

func WithDeploymentOwnerReferences(ownerReferences []metav1.OwnerReference) DeploymentOption

WithDeploymentOwnerReferences adds OwnerReferences to the Deployment.

func WithDeploymentServiceAccount

func WithDeploymentServiceAccount(serviceAccountName string) DeploymentOption

WithDeploymentServiceAccount adds ServiceAccount to the Deployment.

type Listers

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

Listers holds sorters.

func NewListers

func NewListers(objs []runtime.Object) Listers

NewListers creates a Listers object with objs.

func (*Listers) GetAllObjects

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

GetAllObjects returns all the objects.

func (*Listers) GetDeploymentLister

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

GetDeploymentLister returns the Deployment lister.

func (*Listers) GetKubeObjects

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

GetKubeObjects returns the kube objects.

func (*Listers) GetMongoDbSourceLister

func (l *Listers) GetMongoDbSourceLister() v1alpha1listers.MongoDbSourceLister

GetMongoDbSourceLister returns the MongoDbSource lister.

func (*Listers) GetSecretLister

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

GetSecretLister returns the Secret lister.

func (*Listers) GetSourcesObjects

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

GetSourcesObjects returns the sources objects.

type MongoDbSourceOption

type MongoDbSourceOption func(*v1alpha1.MongoDbSource)

MongoDbSourceOption enables further configuration of a CronJob.

func WithMongoDbSourceConnectionFailed

func WithMongoDbSourceConnectionFailed(err string) MongoDbSourceOption

WithMongoDbSourceConnectionFailed updates the status of the connection to be failed.

func WithMongoDbSourceConnectionSuccess

func WithMongoDbSourceConnectionSuccess() MongoDbSourceOption

WithMongoDbSourceConnectionSuccess updates the status of the connection to be successful.

func WithMongoDbSourceDeployed

func WithMongoDbSourceDeployed() MongoDbSourceOption

WithMongoDbSourceDeployed updates the status of the source to Deployed.

func WithMongoDbSourceNotDeployed

func WithMongoDbSourceNotDeployed(name string) MongoDbSourceOption

WithMongoDbSourceNotDeployed updates the status of the source to Not Deployed.

func WithMongoDbSourceSink

func WithMongoDbSourceSink(uri *apis.URL) MongoDbSourceOption

WithMongoDbSourceSink updates the status of the sink to be found.

func WithMongoDbSourceSpec

func WithMongoDbSourceSpec(spec v1alpha1.MongoDbSourceSpec) MongoDbSourceOption

WithMongoDbSourceSpec returns a function that updates the Spec field of the MongoDbSource.

func WithMongoDbSourceUID

func WithMongoDbSourceUID(uid string) MongoDbSourceOption

WithMongoDbSourceUID initializes the UID of the MongoDbSource.

Jump to

Keyboard shortcuts

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