testing

package
v0.29.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2022 License: Apache-2.0 Imports: 52 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MetricsPortName - Prometheus MetricsPort
	MetricsPortName = "metrics"

	// Environment Test Data
	ServiceAccount     = "TestServiceAccount"
	KafkaAdminType     = "kafka"
	MetricsPort        = 9876
	MetricsDomain      = "eventing-kafka"
	HealthPort         = 8082
	ResyncPeriod       = 3600 * time.Minute
	ReceiverImage      = "TestReceiverImage"
	ReceiverReplicas   = 1
	DispatcherImage    = "TestDispatcherImage"
	DispatcherReplicas = 1

	// Channel Test Data
	KafkaChannelNamespace  = "kafkachannel-namespace"
	KafkaChannelName       = "kafkachannel-name"
	KafkaChannelKey        = KafkaChannelNamespace + "/" + KafkaChannelName
	KafkaSecretNamespace   = "eventing-test-ns" // Needs To Match system.Namespace() Call In Reconciliation
	KafkaSecretName        = "kafkasecret-name"
	ReceiverDeploymentName = KafkaSecretName + "-b9176d5f-receiver" // Truncated MD5 Hash Of KafkaSecretName
	ReceiverServiceName    = ReceiverDeploymentName
	TopicName              = KafkaChannelNamespace + "." + KafkaChannelName

	KafkaSecretDataValueUsername = "TestKafkaSecretDataUsername"
	KafkaSecretDataValuePassword = "TestKafkaSecretDataPassword"
	KafkaSecretDataValueSaslType = "PLAIN"

	// NumPartitions - ChannelSpec Test Data
	NumPartitions = 123
	// ReplicationFactor - ChannelSpec Test Data
	ReplicationFactor = 456
	// RetentionDurationISO8601 - ChannelSpec Test Data
	RetentionDurationISO8601 = "P3D"

	// ErrorString - Mock Test Error MetaData
	ErrorString = "Expected Mock Test Error"
	// SuccessString - Mock Test Success MetaData
	SuccessString = "Expected Mock Test Success"

	// DispatcherMemoryRequest - Test Dispatcher Memory Request Resource
	DispatcherMemoryRequest = "20Mi"
	// DispatcherCpuRequest - Test Dispatcher CPU Request Resource
	DispatcherCpuRequest = "100m"
	// DispatcherMemoryLimit - Test Dispatcher Memory Limit Resource
	DispatcherMemoryLimit = "50Mi"
	// DispatcherCpuLimit - Test Dispatcher CPU Limit Resource
	DispatcherCpuLimit = "300m"

	// ReceiverMemoryRequest - Test Receiver Memory Request Resource
	ReceiverMemoryRequest = "10Mi"
	// ReceiverMemoryLimit - Test Receiver Memory Limit Resource
	ReceiverMemoryLimit = "20Mi"
	// ReceiverCpuRequest - Test Receiver CPU Request Resource
	ReceiverCpuRequest = "10m"
	// ReceiverCpuLimit - Test Receiver CPU Limit Resource
	ReceiverCpuLimit = "100m"

	ConfigMapHash = "deadbeef"

	ControllerConfigYaml = `
cloudevents:
  maxIdleConns: 1000
  maxIdleConnsPerHost: 100
channel:
  adminType: kafka
  receiver:
    cpuLimit: 200m
    cpuRequest: 100m
    memoryLimit: 100Mi
    memoryRequest: 50Mi
    replicas: 1
    deploymentAnnotations:
      rdak1: rdav1
    deploymentLabels:
      rdlk1: rdlv1
    podAnnotations:
      rpak1: rpav1
    podLabels:
      rplk1: rplv1
    serviceAnnotations:
      rsak1: rsav1
    serviceLabels:
      rslk1: rslv1
  dispatcher:
    cpuLimit: 500m
    cpuRequest: 300m
    memoryLimit: 128Mi
    memoryRequest: 50Mi
    replicas: 1
    deploymentAnnotations:
      ddak1: ddav1
    deploymentLabels:
      ddlk1: ddlv1
    podAnnotations:
      dpak1: dpav1
    podLabels:
      dplk1: dplv1
    serviceAnnotations:
      dsak1: dsav1
    serviceLabels:
      dslk1: dslv1
kafka:
  authSecretName: ` + KafkaSecretName + `
  authSecretNamespace: ` + KafkaSecretNamespace + `
  enableSaramaLogging: false
  adminType: kafka
`
	SaramaConfigYaml = `` /* 444-byte string literal not displayed */

)

Constants

Variables

View Source
var (
	RetentionDuration     = 3 * 24 * time.Hour // Match RetentionDurationISO8601 Value Above !
	RetentionMillisString = strconv.FormatInt(RetentionDuration.Milliseconds(), 10)
	DeletionTimestamp     = metav1.Now()

	DispatcherDeploymentAnnotations = map[string]string{"DDAKey1": "DDAValue1", "DDAKey2": "DDAValue2", "DDAKey3": "DDAValue3"}
	DispatcherDeploymentLabels      = map[string]string{"DDLKey1": "DDLValue1", "DDLKey2": "DDLValue2", "DDLKey3": "DDLValue3"}
	DispatcherPodAnnotations        = map[string]string{"DPAKey1": "DPAValue1", "DPAKey2": "DPAValue2", "DPAKey3": "DPAValue3"}
	DispatcherPodLabels             = map[string]string{"DPLKey1": "DPLValue1", "DPLKey2": "DPLValue2", "DPLKey3": "DPLValue3"}
	DispatcherServiceAnnotations    = map[string]string{"DSAKey1": "DSAValue1", "DSAKey2": "DSAValue2", "DSAKey3": "DSAValue3"}
	DispatcherServiceLabels         = map[string]string{"DSLKey1": "DSLValue1", "DSLKey2": "DSLValue2", "DSLKey3": "DSLValue3"}

	ReceiverDeploymentAnnotations = map[string]string{"RDAKey1": "RDAValue1", "RDAKey2": "RDAValue2", "RDAKey3": "RDAValue3"}
	ReceiverDeploymentLabels      = map[string]string{"RDLKey1": "RDLValue1", "RDLKey2": "RDLValue2", "RDLKey3": "RDLValue3"}
	ReceiverPodAnnotations        = map[string]string{"RPAKey1": "RPAValue1", "RPAKey2": "RPAValue2", "RPAKey3": "RPAValue3"}
	ReceiverPodLabels             = map[string]string{"RPLKey1": "RPLValue1", "RPLKey2": "RPLValue2", "RPLKey3": "RPLValue3"}
	ReceiverServiceAnnotations    = map[string]string{"RSAKey1": "RSAValue1", "RSAKey2": "RSAValue2", "RSAKey3": "RSAValue3"}
	ReceiverServiceLabels         = map[string]string{"RSLKey1": "RSLValue1", "RSLKey2": "RSLValue2", "RSLKey3": "RSLValue3"}
)

Functions

func MakeFactory

func MakeFactory(ctor Ctor, logger *zap.Logger) Factory

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

func NewChannelOwnerRef

func NewChannelOwnerRef() metav1.OwnerReference

NewChannelOwnerRef Creates A New OwnerReference Model For The Test Channel

func NewConfig

func NewConfig(options ...KafkaConfigOption) *commonconfig.EventingKafkaConfig

NewConfig Sets The Required Config Fields

func NewDeploymentDeleteActionImpl

func NewDeploymentDeleteActionImpl(deployment *appsv1.Deployment) clientgotesting.DeleteActionImpl

NewDeploymentDeleteActionImpl Creates A DeleteActionImpl For A Deployment Delete Command

func NewDeploymentUpdateActionImpl

func NewDeploymentUpdateActionImpl(deployment *appsv1.Deployment) clientgotesting.UpdateActionImpl

NewDeploymentUpdateActionImpl Creates A UpdateActionImpl For A Deployment Update Command

func NewEnvironment

func NewEnvironment() *env.Environment

NewEnvironment Sets The Required Environment Variables

func NewFinalizerPatchActionImpl

func NewFinalizerPatchActionImpl() clientgotesting.PatchActionImpl

NewFinalizerPatchActionImpl Creates A PatchActionImpl For The Finalizer Patch Command

func NewKafkaChannel

func NewKafkaChannel(options ...KafkaChannelOption) *kafkav1beta1.KafkaChannel

NewKafkaChannel Creates A Custom KafkaChannel For Testing

func NewKafkaChannelDispatcherDeployment

func NewKafkaChannelDispatcherDeployment(options ...DeploymentOption) *appsv1.Deployment

NewKafkaChannelDispatcherDeployment Creates A Custom KafkaChannel Dispatcher Deployment For Testing

func NewKafkaChannelDispatcherDeploymentUpdateFailedEvent added in v0.23.0

func NewKafkaChannelDispatcherDeploymentUpdateFailedEvent() string

NewKafkaChannelDispatcherDeploymentUpdateFailedEvent Creates A Dispatcher Deployment Update Failure Event

func NewKafkaChannelDispatcherDeploymentUpdatedEvent added in v0.23.0

func NewKafkaChannelDispatcherDeploymentUpdatedEvent() string

NewKafkaChannelDispatcherDeploymentUpdatedEvent Creates A Dispatcher Deployment Updated Event

func NewKafkaChannelDispatcherService

func NewKafkaChannelDispatcherService(options ...ServiceOption) *corev1.Service

NewKafkaChannelDispatcherService Creates A Custom KafkaChannel Dispatcher Service For Testing

func NewKafkaChannelDispatcherServicePatchFailedEvent added in v0.23.0

func NewKafkaChannelDispatcherServicePatchFailedEvent() string

NewKafkaChannelDispatcherServicePatchFailedEvent Creates A Dispatcher Service Patch Failure Event

func NewKafkaChannelDispatcherServicePatchedEvent added in v0.23.0

func NewKafkaChannelDispatcherServicePatchedEvent() string

NewKafkaChannelDispatcherServicePatchedEvent Creates A Dispatcher Service Patched Event

func NewKafkaChannelFailedFinalizationEvent

func NewKafkaChannelFailedFinalizationEvent() string

NewKafkaChannelFailedFinalizationEvent Creates A Failed KafkaChannel Reconciled Event

func NewKafkaChannelFailedReconciliationEvent

func NewKafkaChannelFailedReconciliationEvent() string

NewKafkaChannelFailedReconciliationEvent Creates A Failed KafkaChannel Reconciled Event

func NewKafkaChannelFinalizerUpdateEvent

func NewKafkaChannelFinalizerUpdateEvent() string

NewKafkaChannelFinalizerUpdateEvent Creates A Successful KafkaChannel Finalizer Update Event

func NewKafkaChannelLabelUpdate

func NewKafkaChannelLabelUpdate(kafkachannel *kafkav1beta1.KafkaChannel) clientgotesting.UpdateActionImpl

NewKafkaChannelLabelUpdate Creates A UpdateActionImpl For The KafkaChannel Labels Update Command

func NewKafkaChannelReceiverDeployment

func NewKafkaChannelReceiverDeployment(options ...DeploymentOption) *appsv1.Deployment

NewKafkaChannelReceiverDeployment Creates A Receiver Deployment For The Test Channel

func NewKafkaChannelReceiverService

func NewKafkaChannelReceiverService(options ...ServiceOption) *corev1.Service

NewKafkaChannelReceiverService Creates A Custom Receiver Service For Testing

func NewKafkaChannelService

func NewKafkaChannelService(options ...ServiceOption) *corev1.Service

NewKafkaChannelService Creates A Custom KafkaChannel "Channel" Service For Testing

func NewKafkaChannelSuccessfulFinalizedEvent

func NewKafkaChannelSuccessfulFinalizedEvent() string

NewKafkaChannelSuccessfulFinalizedEvent Creates A Successful KafkaChannel Finalizer Update Event

func NewKafkaChannelSuccessfulReconciliationEvent

func NewKafkaChannelSuccessfulReconciliationEvent() string

NewKafkaChannelSuccessfulReconciliationEvent Creates A Successful KafkaChannel Reconciled Event

func NewKafkaSecret

func NewKafkaSecret(options ...KafkaSecretOption) *corev1.Secret

NewKafkaSecret Creates A New Kafka Auth Secret For Testing

func NewSecretAndKafkaChannel added in v0.23.0

func NewSecretAndKafkaChannel(options ...KafkaChannelOption) []runtime.Object

NewSecretAndKafkaChannel is a convenience for adding a default kafka secret to a single kafka channel object slice

func NewServiceDeleteActionImpl

func NewServiceDeleteActionImpl(service *corev1.Service) clientgotesting.DeleteActionImpl

NewServiceDeleteActionImpl Creates A DeleteActionImpl For A Service Delete Command

func NewServiceUpdateActionImpl

func NewServiceUpdateActionImpl(service *corev1.Service) clientgotesting.UpdateActionImpl

NewServiceUpdateActionImpl Creates A UpdateActionImpl For A Service Update Command

func WithAddress

func WithAddress(kafkachannel *kafkav1beta1.KafkaChannel)

WithAddress Sets The KafkaChannel's Address

func WithAnnotations

func WithAnnotations(kafkachannel *kafkav1beta1.KafkaChannel)

WithAnnotations Sets The KafkaChannel's Annotations

func WithConfigMapHash added in v0.23.0

func WithConfigMapHash(configMapHash string) func(deployment *appsv1.Deployment)

WithConfigMapHash Adds A Particular Hash Annotation To A Deployment

func WithDeletionTimestamp

func WithDeletionTimestamp(kafkachannel *kafkav1beta1.KafkaChannel)

WithDeletionTimestamp Sets The KafkaChannel's DeletionTimestamp To Current Time

func WithDeletionTimestampDeployment

func WithDeletionTimestampDeployment(deployment *appsv1.Deployment)

WithDeletionTimestampDeployment Sets The Deployment's DeletionTimestamp To Current Time

func WithDeletionTimestampService

func WithDeletionTimestampService(service *corev1.Service)

WithDeletionTimestampService Sets The Service's DeletionTimestamp To Current Time

func WithDifferentArgs added in v0.23.0

func WithDifferentArgs(deployment *appsv1.Deployment)

WithDifferentArgs Changes The Container Args

func WithDifferentCommand added in v0.23.0

func WithDifferentCommand(deployment *appsv1.Deployment)

WithDifferentCommand Changes The Container Command

func WithDifferentEnvironment added in v0.23.0

func WithDifferentEnvironment(deployment *appsv1.Deployment)

WithDifferentEnvironment Adds An Arbitrary Extra Environment Variable

func WithDifferentImage added in v0.23.0

func WithDifferentImage(deployment *appsv1.Deployment)

WithDifferentImage Changes The Container Image

func WithDifferentImagePullPolicy added in v0.23.0

func WithDifferentImagePullPolicy(deployment *appsv1.Deployment)

WithDifferentImagePullPolicy Changes The ImagePullPolicy In The Container

func WithDifferentLifecycle added in v0.23.0

func WithDifferentLifecycle(deployment *appsv1.Deployment)

WithDifferentLifecycle Changes The Lifecycle In The Container

func WithDifferentLivenessProbe added in v0.23.0

func WithDifferentLivenessProbe(deployment *appsv1.Deployment)

WithDifferentLivenessProbe Changes The LivenessProbe In The Container

func WithDifferentName added in v0.23.0

func WithDifferentName(deployment *appsv1.Deployment)

WithDifferentName Changes The Container Name

func WithDifferentPorts added in v0.23.0

func WithDifferentPorts(deployment *appsv1.Deployment)

WithDifferentPorts Changes The Container Ports

func WithDifferentReadinessProbe added in v0.23.0

func WithDifferentReadinessProbe(deployment *appsv1.Deployment)

WithDifferentReadinessProbe Changes The WReadinessProbe In The Container

func WithDifferentReplicas added in v0.23.0

func WithDifferentReplicas(deployment *appsv1.Deployment)

WithDifferentReplicas Changes The Replicas In The Spec

func WithDifferentSecurityContext added in v0.23.0

func WithDifferentSecurityContext(deployment *appsv1.Deployment)

WithDifferentSecurityContext Changes The SecurityContext In The Container

func WithDifferentServiceStatus added in v0.23.0

func WithDifferentServiceStatus(service *corev1.Service)

WithDifferentServiceStatus Changes The LoadBalancerIngress Hostname

func WithDifferentTerminationPath added in v0.23.0

func WithDifferentTerminationPath(deployment *appsv1.Deployment)

WithDifferentTerminationPath Changes The TerminationPath In The Container

func WithDifferentTerminationPolicy added in v0.23.0

func WithDifferentTerminationPolicy(deployment *appsv1.Deployment)

WithDifferentTerminationPolicy Changes The TerminationPolicy In The Container

func WithDifferentVolumeDevices added in v0.23.0

func WithDifferentVolumeDevices(deployment *appsv1.Deployment)

WithDifferentVolumeDevices Changes The WithDifferentVolumeDevices

func WithDifferentVolumeMounts added in v0.23.0

func WithDifferentVolumeMounts(deployment *appsv1.Deployment)

WithDifferentVolumeMounts Changes The Container Volume Mounts

func WithDifferentVolumes added in v0.23.0

func WithDifferentVolumes(deployment *appsv1.Deployment)

WithDifferentVolumes Changes The Volumes In The Spec

func WithDifferentWorkingDir added in v0.23.0

func WithDifferentWorkingDir(deployment *appsv1.Deployment)

WithDifferentWorkingDir Changes The Container WorkingDir

func WithDispatcherDeploymentFailed added in v0.29.0

func WithDispatcherDeploymentFailed(kafkachannel *kafkav1beta1.KafkaChannel)

WithDispatcherDeploymentFailed Sets The KafkaChannel's Dispatcher Deployment As Failed

func WithDispatcherDeploymentReady

func WithDispatcherDeploymentReady(_ *kafkav1beta1.KafkaChannel)

WithDispatcherDeploymentReady Sets The KafkaChannel's Dispatcher Deployment As READY

func WithDispatcherServiceFailed added in v0.29.0

func WithDispatcherServiceFailed(kafkachannel *kafkav1beta1.KafkaChannel)

func WithDispatcherServicePatchFailed added in v0.23.0

func WithDispatcherServicePatchFailed(kafkachannel *kafkav1beta1.KafkaChannel)

WithDispatcherServicePatchFailed Sets The KafkaChannel's Dispatcher Patch As Failed

func WithDispatcherServiceReady added in v0.29.0

func WithDispatcherServiceReady(kafkachannel *kafkav1beta1.KafkaChannel)

func WithDispatcherUpdateFailed added in v0.23.0

func WithDispatcherUpdateFailed(kafkachannel *kafkav1beta1.KafkaChannel)

WithDispatcherUpdateFailed Sets The KafkaChannel's Dispatcher Update As Failed

func WithEmptySpec added in v0.23.0

func WithEmptySpec(kafkachannel *kafkav1beta1.KafkaChannel)

WithEmptySpec Removes The KafkaChannel's Spec

func WithExtraAnnotations added in v0.23.0

func WithExtraAnnotations(deployment *appsv1.Deployment)

WithExtraAnnotations Adds An Arbitrary Additional Annotation

func WithExtraLabels added in v0.23.0

func WithExtraLabels(deployment *appsv1.Deployment)

WithExtraLabels Adds An Arbitrary Additional Label

func WithExtraServiceLabels added in v0.23.0

func WithExtraServiceLabels(service *corev1.Service)

WithExtraServiceLabels Adds An Arbitrary Additional Label

func WithFinalizer

func WithFinalizer(kafkachannel *kafkav1beta1.KafkaChannel)

WithFinalizer Sets The KafkaChannel's Finalizer

func WithInitializedConditions

func WithInitializedConditions(kafkachannel *kafkav1beta1.KafkaChannel)

WithInitializedConditions Sets The KafkaChannel's Status To Initialized State

func WithKafkaChannelConfigurationFailedNoSecret added in v0.23.0

func WithKafkaChannelConfigurationFailedNoSecret(kafkachannel *kafkav1beta1.KafkaChannel)

WithKafkaChannelConfigurationFailedNoSecret Sets The KafkaChannel's Configuration As Failed - No Secret

func WithKafkaChannelServiceFailed

func WithKafkaChannelServiceFailed(kafkachannel *kafkav1beta1.KafkaChannel)

WithKafkaChannelServiceFailed Sets The KafkaChannel's Services As Failed

func WithKafkaChannelServiceReady

func WithKafkaChannelServiceReady(kafkachannel *kafkav1beta1.KafkaChannel)

WithKafkaChannelServiceReady Sets The KafkaChannel's Service As READY

func WithKafkaSecretFinalizer

func WithKafkaSecretFinalizer(secret *corev1.Secret)

WithKafkaSecretFinalizer Sets The Kafka Secret's Finalizer

func WithLabels

func WithLabels(kafkachannel *kafkav1beta1.KafkaChannel)

WithLabels Sets The KafkaChannel's Labels

func WithMetaData

func WithMetaData(kafkachannel *kafkav1beta1.KafkaChannel)

WithMetaData Sets The KafkaChannel's MetaData

func WithMissingEnvironment added in v0.23.0

func WithMissingEnvironment(deployment *appsv1.Deployment)

WithMissingEnvironment Clears The Environment

func WithNoDispatcherResources added in v0.20.0

func WithNoDispatcherResources(kafkaConfig *commonconfig.EventingKafkaConfig)

WithNoDispatcherResources Removes The Dispatcher Resource Requests And Limits

func WithNoReceiverResources added in v0.20.0

func WithNoReceiverResources(kafkaConfig *commonconfig.EventingKafkaConfig)

WithNoReceiverResources Removes The Receiver Resource Requests And Limits

func WithReceiverDeploymentFailed

func WithReceiverDeploymentFailed(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverDeploymentFailed Sets The KafkaChannel's Receiver Deployment As Failed

func WithReceiverDeploymentFailedNoSecret added in v0.23.0

func WithReceiverDeploymentFailedNoSecret(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverDeploymentFailedNoSecret Sets The KafkaChannel's Receiver Deployment As Failed ("no secret found")

func WithReceiverDeploymentFailedTimestamp added in v0.23.0

func WithReceiverDeploymentFailedTimestamp(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverDeploymentFailedTimestamp Sets The KafkaChannel's Receiver Deployment As Failed ("encountered Receiver Deployment with DeletionTimestamp" ...)

func WithReceiverDeploymentReady

func WithReceiverDeploymentReady(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverDeploymentReady Sets The KafkaChannel's Receiver Deployment As READY ("EndpointsReady")

func WithReceiverServiceFailed

func WithReceiverServiceFailed(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverServiceFailed Sets The KafkaChannel's Receiver Service As Failed

func WithReceiverServiceFailedNoSecret added in v0.23.0

func WithReceiverServiceFailedNoSecret(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverServiceFailedNoSecret Sets The KafkaChannel's Receiver Service As Failed ("no secret found")

func WithReceiverServiceFailedTimestamp added in v0.23.0

func WithReceiverServiceFailedTimestamp(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverServiceFailedTimestamp Sets The KafkaChannel's Receiver Service As Failed ("encountered Receiver Service with DeletionTimestamp" ...)

func WithReceiverServiceReady

func WithReceiverServiceReady(kafkachannel *kafkav1beta1.KafkaChannel)

WithReceiverServiceReady Sets The KafkaChannel's Receiver Service As READY ("ChannelServiceReady")

func WithTopicReady

func WithTopicReady(kafkachannel *kafkav1beta1.KafkaChannel)

WithTopicReady Sets The KafkaChannel's Topic READY

func WithoutAnnotations added in v0.23.0

func WithoutAnnotations(deployment *appsv1.Deployment)

WithoutAnnotations Clears The Annotations

func WithoutFinalizersDeployment

func WithoutFinalizersDeployment(deployment *appsv1.Deployment)

WithoutFinalizersDeployment Clears The Dispatcher Deployment's Finalizers

func WithoutFinalizersService

func WithoutFinalizersService(service *corev1.Service)

WithoutFinalizersService Clears The Specified Service's Finalizers

func WithoutLabels added in v0.23.0

func WithoutLabels(deployment *appsv1.Deployment)

WithoutLabels Clears The Labels

func WithoutResources added in v0.20.0

func WithoutResources(deployment *appsv1.Deployment)

WithoutResources Removes The Resource Limits And Requests

func WithoutServiceLabels added in v0.23.0

func WithoutServiceLabels(service *corev1.Service)

WithoutServiceLabels Clears The Labels

func WithoutServicePorts added in v0.23.0

func WithoutServicePorts(service *corev1.Service)

WithoutServicePorts Clears The Service Ports

func WithoutServiceSelector added in v0.23.0

func WithoutServiceSelector(service *corev1.Service)

WithoutServiceSelector Clears The Selector

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(deployment *appsv1.Deployment)

DeploymentOption Allows Customization Of A Deployment

type KafkaChannelOption

type KafkaChannelOption func(*kafkav1beta1.KafkaChannel)

KafkaChannelOption Enables Customization Of A KafkaChannel

type KafkaConfigOption added in v0.20.0

type KafkaConfigOption func(kafkaConfig *commonconfig.EventingKafkaConfig)

KafkaConfigOption Enables Customization Of An EventingKafkaConfig

type KafkaSecretOption

type KafkaSecretOption func(secret *corev1.Secret)

KafkaSecretOption Enables Customization Of A Kafka Secret

type Listers

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

func NewListers

func NewListers(objs []runtime.Object) Listers

func (*Listers) GetAllObjects

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

func (*Listers) GetDeploymentLister

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

func (*Listers) GetEndpointsLister

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

func (*Listers) GetEventingObjects

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

func (*Listers) GetEventsObjects

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

func (*Listers) GetKafkaChannelLister

func (l *Listers) GetKafkaChannelLister() kafkalisters.KafkaChannelLister

func (*Listers) GetKafkaChannelObjects

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

func (*Listers) GetKubeObjects

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

func (*Listers) GetSecretLister

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

func (*Listers) GetServiceLister

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

type MockAdminClient

type MockAdminClient struct {
	MockCreateTopicFunc func(context.Context, string, *sarama.TopicDetail) *sarama.TopicError
	MockDeleteTopicFunc func(context.Context, string) *sarama.TopicError
	MockCloseFunc       func() error
	// contains filtered or unexported fields
}

Mock Kafka AdminClient Implementation

func (*MockAdminClient) Close

func (m *MockAdminClient) Close() error

Mock Kafka AdminClient Close Function - NoOp

func (*MockAdminClient) CloseCalled

func (m *MockAdminClient) CloseCalled() bool

Check On Calls To Close()

func (*MockAdminClient) CreateTopic

func (m *MockAdminClient) CreateTopic(ctx context.Context, topicName string, topicDetail *sarama.TopicDetail) *sarama.TopicError

Mock Kafka AdminClient CreateTopic() Function - Calls Custom CreateTopic() If Specified, Otherwise Returns Success

func (*MockAdminClient) CreateTopicsCalled

func (m *MockAdminClient) CreateTopicsCalled() bool

Check On Calls To CreateTopics()

func (*MockAdminClient) DeleteTopic

func (m *MockAdminClient) DeleteTopic(ctx context.Context, topicName string) *sarama.TopicError

Mock Kafka AdminClient DeleteTopic() Function - Calls Custom DeleteTopic() If Specified, Otherwise Returns Success

func (*MockAdminClient) DeleteTopicsCalled

func (m *MockAdminClient) DeleteTopicsCalled() bool

Check On Calls To DeleteTopics()

func (*MockAdminClient) GetKafkaSecretName

func (m *MockAdminClient) GetKafkaSecretName(_ string) string

Mock Kafka Secret Name Function - Return Test Data

type ServiceOption

type ServiceOption func(service *corev1.Service)

ServiceOption Allows Customization Of A Service

Jump to

Keyboard shortcuts

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