testing

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 47 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeFactory

func MakeFactory(ctor Ctor) Factory

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

func NewChannel

func NewChannel(name, namespace string, so ...ChannelOption) *v1alpha1.Channel

NewChannel creates a Channel with ChannelOptions

func NewChannelWithoutNamespace

func NewChannelWithoutNamespace(name string, so ...ChannelOption) *v1alpha1.Channel

NewChannelWithoutNamespace creates a Channel with ChannelOptions but without a specific namespace

func NewDeployment

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

NewDeployment creates a Deployment with DeploymentOptions.

func NewNamespace

func NewNamespace(name string, o ...NamespaceOption) *corev1.Namespace

NewNamespace creates a Namespace with NamespaceOptions

func NewPubSub added in v0.10.0

func NewPubSub(name, namespace string, so ...PubSubOption) *v1alpha1.PubSub

NewPubSub creates a PubSub with PubSubOptions

func NewPullSubscription

func NewPullSubscription(name, namespace string, so ...PullSubscriptionOption) *v1alpha1.PullSubscription

NewPullSubscription creates a PullSubscription with PullSubscriptionOptions

func NewPullSubscriptionWithNoDefaults added in v0.9.0

func NewPullSubscriptionWithNoDefaults(name, namespace string, so ...PullSubscriptionOption) *v1alpha1.PullSubscription

NewPullSubscriptionWithNoDefaults creates a PullSubscription with PullSubscriptionOptions but does not set defaults.

func NewPullSubscriptionWithoutNamespace

func NewPullSubscriptionWithoutNamespace(name string, so ...PullSubscriptionOption) *v1alpha1.PullSubscription

NewPullSubscriptionWithoutNamespace creates a PullSubscription with PullSubscriptionOptions but without a specific namespace

func NewScheduler added in v0.9.0

func NewScheduler(name, namespace string, so ...SchedulerOption) *v1alpha1.Scheduler

NewScheduler creates a Scheduler with SchedulerOptions

func NewService

func NewService(name, namespace string, so ...ServiceOption) *corev1.Service

NewService creates a Service with ServiceOptions

func NewStorage added in v0.9.0

func NewStorage(name, namespace string, so ...StorageOption) *v1alpha1.Storage

NewStorage creates a Storage with StorageOptions

func NewTopic

func NewTopic(name, namespace string, so ...TopicOption) *v1alpha1.Topic

NewTopic creates a Topic with TopicOptions

func NewUnstructured

func NewUnstructured(gvk metav1.GroupVersionKind, name, namespace string, uo ...UnstructuredOption) *unstructured.Unstructured

NewUnstructured creates a unstructured.Unstructured with UnstructuredOption

func WithChannelDefaults

func WithChannelDefaults(s *v1alpha1.Channel)

func WithChannelDeleted

func WithChannelDeleted(s *v1alpha1.Channel)

func WithInitChannelConditions

func WithInitChannelConditions(s *v1alpha1.Channel)

WithInitChannelConditions initializes the Channels's conditions.

func WithInitPubSubConditions added in v0.10.0

func WithInitPubSubConditions(ps *v1alpha1.PubSub)

WithInitPubSubConditions initializes the PubSub's conditions.

func WithInitPullSubscriptionConditions

func WithInitPullSubscriptionConditions(s *v1alpha1.PullSubscription)

WithInitPullSubscriptionConditions initializes the PullSubscriptions's conditions.

func WithInitSchedulerConditions added in v0.9.0

func WithInitSchedulerConditions(s *v1alpha1.Scheduler)

WithInitSchedulerConditions initializes the Schedulers's conditions.

func WithInitStorageConditions added in v0.9.0

func WithInitStorageConditions(s *v1alpha1.Storage)

WithInitStorageConditions initializes the Storages's conditions.

func WithInitTopicConditions

func WithInitTopicConditions(s *v1alpha1.Topic)

WithInitTopicConditions initializes the Topics's conditions.

func WithNamespaceDeleted

func WithNamespaceDeleted(n *corev1.Namespace)

func WithPullSubscriptionDeleted

func WithPullSubscriptionDeleted(s *v1alpha1.PullSubscription)

func WithTopicDeleted

func WithTopicDeleted(s *v1alpha1.Topic)

func WithTopicDeployed

func WithTopicDeployed(s *v1alpha1.Topic)

Types

type ChannelOption

type ChannelOption func(*v1alpha1.Channel)

ChannelOption enables further configuration of a Channel.

func WithChannelAddress

func WithChannelAddress(url string) ChannelOption

func WithChannelGenerateName

func WithChannelGenerateName(generateName string) ChannelOption

func WithChannelLabels

func WithChannelLabels(labels map[string]string) ChannelOption

func WithChannelMarkTopicCreating

func WithChannelMarkTopicCreating(topicID string) ChannelOption

func WithChannelOwnerReferences

func WithChannelOwnerReferences(ownerReferences []metav1.OwnerReference) ChannelOption

func WithChannelReady

func WithChannelReady(topicID string) ChannelOption

func WithChannelSpec

func WithChannelSpec(spec v1alpha1.ChannelSpec) ChannelOption

func WithChannelSubscribers

func WithChannelSubscribers(subscribers []duckv1alpha1.SubscriberSpec) ChannelOption

func WithChannelSubscribersStatus

func WithChannelSubscribersStatus(subscribers []duckv1alpha1.SubscriberStatus) ChannelOption

func WithChannelTopic

func WithChannelTopic(topicID string) ChannelOption

func WithChannelUID

func WithChannelUID(uid types.UID) ChannelOption

type Ctor

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

func WithDeploymentContainer

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

func WithDeploymentLabels

func WithDeploymentLabels(labels map[string]string) DeploymentOption

func WithDeploymentOwnerReferences

func WithDeploymentOwnerReferences(ownerReferences []metav1.OwnerReference) DeploymentOption

func WithDeploymentServiceAccount

func WithDeploymentServiceAccount(serviceAccountName string) DeploymentOption

type Listers

type Listers struct {
	servingv1alpha1listers.ConfigurationLister
	// contains filtered or unexported fields
}

func NewListers

func NewListers(objs []runtime.Object) Listers

func (*Listers) GetAllObjects

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

func (*Listers) GetChannelLister

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

func (*Listers) GetConfigMapLister

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

func (*Listers) GetDeploymentLister

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

func (*Listers) GetEndpointsLister

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

func (*Listers) GetEventsObjects

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

func (*Listers) GetJobLister added in v0.9.0

func (l *Listers) GetJobLister() batchv1listers.JobLister

func (*Listers) GetK8sServiceLister

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

func (*Listers) GetKubeObjects

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

func (*Listers) GetNamespaceLister

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

func (*Listers) GetPubSubLister added in v0.10.0

func (l *Listers) GetPubSubLister() eventslisters.PubSubLister

func (*Listers) GetPullSubscriptionLister

func (l *Listers) GetPullSubscriptionLister() pubsublisters.PullSubscriptionLister

func (*Listers) GetRoleBindingLister

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

func (*Listers) GetSchedulerLister added in v0.9.0

func (l *Listers) GetSchedulerLister() eventslisters.SchedulerLister

func (*Listers) GetServiceAccountLister

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

func (*Listers) GetServingObjects

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

func (*Listers) GetSinkObjects

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

func (*Listers) GetStorageLister added in v0.9.0

func (l *Listers) GetStorageLister() eventslisters.StorageLister

func (*Listers) GetTopicLister

func (l *Listers) GetTopicLister() pubsublisters.TopicLister

func (*Listers) GetV1ServiceLister added in v0.10.0

func (l *Listers) GetV1ServiceLister() servingv1listers.ServiceLister

func (*Listers) GetV1alpha1ServiceLister

func (l *Listers) GetV1alpha1ServiceLister() servingv1alpha1listers.ServiceLister

func (*Listers) GetV1beta1ServiceLister

func (l *Listers) GetV1beta1ServiceLister() servingv1beta1listers.ServiceLister

type MockTracker added in v0.10.0

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

MockTracker is a mock AddressableTracker.

func (*MockTracker) OnChanged added in v0.10.0

func (at *MockTracker) OnChanged(obj interface{})

OnChanged implements the tracker.Interface interface.

func (*MockTracker) Track added in v0.10.0

func (at *MockTracker) Track(ref corev1.ObjectReference, obj interface{}) error

Track implements the tracker.Interface interface.

func (*MockTracker) TrackReference added in v0.11.0

func (at *MockTracker) TrackReference(ref tracker.Reference, obj interface{}) error

TrackReference implements the tracker.Interface interface.

type NamespaceOption

type NamespaceOption func(*corev1.Namespace)

NamespaceOption enables further configuration of a Namespace.

func WithNamespaceLabeled

func WithNamespaceLabeled(labels map[string]string) NamespaceOption

type PubSubOption added in v0.10.0

type PubSubOption func(*v1alpha1.PubSub)

PubSubOption enables further configuration of a PubSub.

func WithPubSubFinalizers added in v0.10.0

func WithPubSubFinalizers(finalizers ...string) PubSubOption

func WithPubSubObjectMetaGeneration added in v0.10.0

func WithPubSubObjectMetaGeneration(generation int64) PubSubOption

func WithPubSubPullSubscriptionNotReady added in v0.10.0

func WithPubSubPullSubscriptionNotReady(reason, message string) PubSubOption

WithPubSubPullSubscriptionNotReady marks the condition that the topic is not ready

func WithPubSubPullSubscriptionReady added in v0.10.0

func WithPubSubPullSubscriptionReady() PubSubOption

WithPubSubPullSubscriptionReady marks the condition that the topic is not ready

func WithPubSubSink added in v0.10.0

func WithPubSubSink(gvk metav1.GroupVersionKind, name string) PubSubOption

func WithPubSubSinkURI added in v0.10.0

func WithPubSubSinkURI(url *apis.URL) PubSubOption

WithPubSubSinkURI sets the status for sink URI

func WithPubSubStatusObservedGeneration added in v0.10.0

func WithPubSubStatusObservedGeneration(generation int64) PubSubOption

func WithPubSubTopic added in v0.10.0

func WithPubSubTopic(topicID string) PubSubOption

type PullSubscriptionOption

type PullSubscriptionOption func(*v1alpha1.PullSubscription)

PullSubscriptionOption enables further configuration of a PullSubscription.

func WithPullSubscriptionAnnotations added in v0.9.0

func WithPullSubscriptionAnnotations(annotations map[string]string) PullSubscriptionOption

func WithPullSubscriptionFinalizers

func WithPullSubscriptionFinalizers(finalizers ...string) PullSubscriptionOption

func WithPullSubscriptionGenerateName

func WithPullSubscriptionGenerateName(generateName string) PullSubscriptionOption

func WithPullSubscriptionJobFailure added in v0.10.0

func WithPullSubscriptionJobFailure(subscriptionID, reason, message string) PullSubscriptionOption

func WithPullSubscriptionLabels

func WithPullSubscriptionLabels(labels map[string]string) PullSubscriptionOption

func WithPullSubscriptionMarkNoSubscription

func WithPullSubscriptionMarkNoSubscription(subscriptionID string) PullSubscriptionOption

func WithPullSubscriptionMarkSink

func WithPullSubscriptionMarkSink(uri string) PullSubscriptionOption

func WithPullSubscriptionMarkSubscribing

func WithPullSubscriptionMarkSubscribing(subscriptionID string) PullSubscriptionOption

func WithPullSubscriptionMarkUnsubscribing

func WithPullSubscriptionMarkUnsubscribing(subscriptionID string) PullSubscriptionOption

func WithPullSubscriptionObjectMetaGeneration added in v0.10.0

func WithPullSubscriptionObjectMetaGeneration(generation int64) PullSubscriptionOption

func WithPullSubscriptionOwnerReferences

func WithPullSubscriptionOwnerReferences(ownerReferences []metav1.OwnerReference) PullSubscriptionOption

func WithPullSubscriptionReady

func WithPullSubscriptionReady(sink string) PullSubscriptionOption

func WithPullSubscriptionReadyStatus added in v0.10.0

func WithPullSubscriptionReadyStatus(status corev1.ConditionStatus, reason, message string) PullSubscriptionOption

func WithPullSubscriptionSink

func WithPullSubscriptionSink(gvk metav1.GroupVersionKind, name string) PullSubscriptionOption

func WithPullSubscriptionSinkNotFound

func WithPullSubscriptionSinkNotFound() PullSubscriptionOption

func WithPullSubscriptionSpecWithNoDefaults added in v0.9.0

func WithPullSubscriptionSpecWithNoDefaults(spec v1alpha1.PullSubscriptionSpec) PullSubscriptionOption

Same as withPullSubscriptionSpec but does not set defaults

func WithPullSubscriptionStatusObservedGeneration added in v0.10.0

func WithPullSubscriptionStatusObservedGeneration(generation int64) PullSubscriptionOption

func WithPullSubscriptionSubscription

func WithPullSubscriptionSubscription(subscriptionID string) PullSubscriptionOption

func WithPullSubscriptionUID

func WithPullSubscriptionUID(uid types.UID) PullSubscriptionOption

type SchedulerOption added in v0.9.0

type SchedulerOption func(*v1alpha1.Scheduler)

SchedulerOption enables further configuration of a Scheduler.

func WithSchedulerData added in v0.9.0

func WithSchedulerData(data string) SchedulerOption

func WithSchedulerFinalizers added in v0.9.0

func WithSchedulerFinalizers(finalizers ...string) SchedulerOption

func WithSchedulerJobNotReady added in v0.9.0

func WithSchedulerJobNotReady(reason, message string) SchedulerOption

WithSchedulerJobNotReady marks the condition that the Scheduler Job is not ready.

func WithSchedulerJobReady added in v0.9.0

func WithSchedulerJobReady(jobName string) SchedulerOption

WithSchedulerJobReady marks the condition that the Scheduler Job is ready and sets Status.JobName to jobName.

func WithSchedulerLocation added in v0.9.0

func WithSchedulerLocation(location string) SchedulerOption

func WithSchedulerPullSubscriptionNotReady added in v0.9.0

func WithSchedulerPullSubscriptionNotReady(reason, message string) SchedulerOption

WithSchedulerPullSubscriptionNotReady marks the condition that the topic is not ready

func WithSchedulerPullSubscriptionReady added in v0.9.0

func WithSchedulerPullSubscriptionReady() SchedulerOption

WithSchedulerPullSubscriptionNotReady marks the condition that the topic is not ready

func WithSchedulerSchedule added in v0.9.0

func WithSchedulerSchedule(schedule string) SchedulerOption

func WithSchedulerSink added in v0.9.0

func WithSchedulerSink(gvk metav1.GroupVersionKind, name string) SchedulerOption

func WithSchedulerSinkURI added in v0.9.0

func WithSchedulerSinkURI(url *apis.URL) SchedulerOption

WithSchedulerSinkURI sets the status for sink URI

func WithSchedulerTopicNotReady added in v0.9.0

func WithSchedulerTopicNotReady(reason, message string) SchedulerOption

WithSchedulerTopicNotReady marks the condition that the topic is not ready

func WithSchedulerTopicReady added in v0.9.0

func WithSchedulerTopicReady(topicID, projectID string) SchedulerOption

WithSchedulerTopicNotReady marks the condition that the topic is not ready

type ServiceOption

type ServiceOption func(*corev1.Service)

ServiceOption enables further configuration of a Service.

func WithServiceLabels

func WithServiceLabels(labels map[string]string) ServiceOption

func WithServiceOwnerReferences

func WithServiceOwnerReferences(ownerReferences []metav1.OwnerReference) ServiceOption

func WithServicePorts

func WithServicePorts(ports []corev1.ServicePort) ServiceOption

type StorageOption added in v0.9.0

type StorageOption func(*v1alpha1.Storage)

StorageOption enables further configuration of a Storage.

func WithDeletionTimestamp added in v0.10.0

func WithDeletionTimestamp() StorageOption

func WithStorageBucket added in v0.9.0

func WithStorageBucket(bucket string) StorageOption

func WithStorageEventTypes added in v0.9.0

func WithStorageEventTypes(eventTypes []string) StorageOption

func WithStorageFinalizers added in v0.9.0

func WithStorageFinalizers(finalizers ...string) StorageOption

func WithStorageNotificationID added in v0.9.0

func WithStorageNotificationID(notificationID string) StorageOption

WithStorageNotificationId sets the status for Notification ID

func WithStorageNotificationNotReady added in v0.9.0

func WithStorageNotificationNotReady(reason, message string) StorageOption

WithStorageNotificationNotReady marks the condition that the GCS Notification is not ready.

func WithStorageNotificationReady added in v0.9.0

func WithStorageNotificationReady() StorageOption

WithStorageNotificationReady marks the condition that the GCS Notification is ready.

func WithStorageObjectMetaGeneration added in v0.10.0

func WithStorageObjectMetaGeneration(generation int64) StorageOption

func WithStorageProjectID added in v0.9.0

func WithStorageProjectID(projectID string) StorageOption

WithStorageProjectId sets the status for Project ID

func WithStoragePullSubscriptionNotReady added in v0.9.0

func WithStoragePullSubscriptionNotReady(reason, message string) StorageOption

WithStoragePullSubscriptionNotReady marks the condition that the topic is not ready

func WithStoragePullSubscriptionReady added in v0.9.0

func WithStoragePullSubscriptionReady() StorageOption

WithStoragePullSubscriptionNotReady marks the condition that the topic is not ready

func WithStorageSink added in v0.9.0

func WithStorageSink(gvk metav1.GroupVersionKind, name string) StorageOption

func WithStorageSinkURI added in v0.9.0

func WithStorageSinkURI(url *apis.URL) StorageOption

WithStorageSinkURI sets the status for sink URI

func WithStorageStatusObservedGeneration added in v0.10.0

func WithStorageStatusObservedGeneration(generation int64) StorageOption

func WithStorageTopicNotReady added in v0.9.0

func WithStorageTopicNotReady(reason, message string) StorageOption

WithStorageTopicNotReady marks the condition that the topic is not ready

func WithStorageTopicReady added in v0.9.0

func WithStorageTopicReady(topicID string) StorageOption

WithStorageTopicNotReady marks the condition that the topic is not ready

type TopicOption

type TopicOption func(*v1alpha1.Topic)

TopicOption enables further configuration of a Topic.

func WithTopicAddress

func WithTopicAddress(uri string) TopicOption

func WithTopicFinalizers

func WithTopicFinalizers(finalizers ...string) TopicOption

func WithTopicJobFailure added in v0.10.0

func WithTopicJobFailure(topicID, reason, message string) TopicOption

func WithTopicLabels

func WithTopicLabels(labels map[string]string) TopicOption

func WithTopicMarkTopicCreating

func WithTopicMarkTopicCreating(topicID string) TopicOption

func WithTopicMarkTopicVerifying

func WithTopicMarkTopicVerifying(topicID string) TopicOption

func WithTopicOwnerReferences

func WithTopicOwnerReferences(ownerReferences []metav1.OwnerReference) TopicOption

func WithTopicProjectID added in v0.9.0

func WithTopicProjectID(projectID string) TopicOption

func WithTopicPropagationPolicy

func WithTopicPropagationPolicy(policy string) TopicOption

func WithTopicReady

func WithTopicReady(topicID string) TopicOption

func WithTopicSpec

func WithTopicSpec(spec v1alpha1.TopicSpec) TopicOption

func WithTopicTopicDeleted

func WithTopicTopicDeleted(topicID string) TopicOption

func WithTopicTopicDeleting

func WithTopicTopicDeleting(topicID string) TopicOption

func WithTopicTopicID

func WithTopicTopicID(topicID string) TopicOption

func WithTopicUID

func WithTopicUID(uid types.UID) TopicOption

type UnstructuredOption

type UnstructuredOption func(*unstructured.Unstructured)

UnstructuredOption enables further configuration of a Unstructured.

func WithUnstructuredAddressable

func WithUnstructuredAddressable(hostname string) UnstructuredOption

Jump to

Keyboard shortcuts

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