testing

package
v0.22.2 Latest Latest
Warning

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

Go to latest
Published: May 4, 2021 License: Apache-2.0 Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BrokerUUID      = "e7185016-5d98-4b54-84e8-3b1cd4acc6b4"
	BrokerNamespace = "test-namespace"
	BrokerName      = "test-broker"
)
View Source
const (
	ConfigMapNamespace = "test-namespace-config-map"
	ConfigMapName      = "test-config-cm"

	ServiceURL = "http://test-service.test-service-namespace.svc.cluster.local/"

	TriggerUUID = "e7185016-5d98-4b54-84e8-3b1cd4acc6b5"

	SecretResourceVersion = "1234"
	SecretUUID            = "a7185016-5d98-4b54-84e8-3b1cd4acc6b6"
)
View Source
const (
	SinkUUID      = "e7185016-5d98-4b54-84e8-3b1cd4acc6b5"
	SinkNamespace = "sink-namespace"
	SinkName      = "sink-name"

	SinkNumPartitions     = 10
	SinkReplicationFactor = 3

	SinkNotPresentErrFormat = "failed to describe topic %s: %v"
)

Variables

View Source
var DefaultConfigs = &broker.Configs{

	Env: config.Env{
		DataPlaneConfigMapNamespace: "knative-eventing",
		DataPlaneConfigMapName:      "kafka-broker-brokers-triggers",
		IngressName:                 "kafka-broker-receiver",
		SystemNamespace:             "knative-eventing",
		DataPlaneConfigFormat:       base.Json,
		DefaultBackoffDelayMs:       1000,
	},

	BootstrapServers: "",
}
View Source
var (
	Formats = []string{base.Protobuf, base.Json}
)

Functions

func BootstrapServers added in v0.18.0

func BootstrapServers(bootstrapServers []string) func(sink *eventing.KafkaSink)

func BrokerAddressable added in v0.18.0

func BrokerAddressable(configs *Configs) func(broker *eventing.Broker)

func BrokerConfig

func BrokerConfig(bootstrapServers string, numPartitions, replicationFactor int, options ...CMOption) *corev1.ConfigMap

func BrokerConfigMapUpdatedReady added in v0.18.0

func BrokerConfigMapUpdatedReady(configs *Configs) func(broker *eventing.Broker)

func BrokerConfigNotParsed added in v0.18.0

func BrokerConfigNotParsed(reason string) func(broker *eventing.Broker)

func BrokerConfigParsed added in v0.18.0

func BrokerConfigParsed(broker *eventing.Broker)

func BrokerDataPlaneAvailable added in v0.18.0

func BrokerDataPlaneAvailable(broker *eventing.Broker)

func BrokerDataPlaneNotAvailable added in v0.18.0

func BrokerDataPlaneNotAvailable(broker *eventing.Broker)

func BrokerDispatcherPod added in v0.18.0

func BrokerDispatcherPod(namespace string, annotations map[string]string) runtime.Object

func BrokerDispatcherPodUpdate added in v0.18.0

func BrokerDispatcherPodUpdate(namespace string, annotations map[string]string) clientgotesting.UpdateActionImpl

func BrokerFailedToCreateTopic added in v0.18.0

func BrokerFailedToCreateTopic(broker *eventing.Broker)

func BrokerFailedToGetConfigMap added in v0.18.0

func BrokerFailedToGetConfigMap(configs *Configs) func(broker *eventing.Broker)

func BrokerReady

func BrokerReady(broker *eventing.Broker)

func BrokerReceiverPod added in v0.18.0

func BrokerReceiverPod(namespace string, annotations map[string]string) runtime.Object

func BrokerReceiverPodUpdate added in v0.18.0

func BrokerReceiverPodUpdate(namespace string, annotations map[string]string) clientgotesting.UpdateActionImpl

func BrokerTopic added in v0.18.0

func BrokerTopic() string

func BrokerTopicReady added in v0.18.0

func BrokerTopicReady(broker *eventing.Broker)

func ConfigMapUpdate

func ConfigMapUpdate(configs *Configs, contract *contract.Contract) clientgotesting.UpdateActionImpl

func InitSinkConditions added in v0.18.0

func InitSinkConditions(sink *eventing.KafkaSink)

func KReference

func KReference(configMap *corev1.ConfigMap) *duckv1.KReference

func NewBroker

func NewBroker(options ...reconcilertesting.BrokerOption) runtime.Object

NewBroker creates a new Broker with broker class equals to kafka.BrokerClass.

func NewConfigMap

func NewConfigMap(configs *Configs, data []byte) runtime.Object

func NewConfigMapFromContract added in v0.18.0

func NewConfigMapFromContract(contract *contract.Contract, configs *Configs) runtime.Object

func NewDeletedBroker

func NewDeletedBroker(options ...reconcilertesting.BrokerOption) runtime.Object

func NewDeletedSink added in v0.18.0

func NewDeletedSink(options ...SinkOption) runtime.Object

func NewFactory

func NewFactory(configs *broker.Configs, ctor Ctor) Factory

func NewSSLSecret added in v0.21.0

func NewSSLSecret(ns, name string) *corev1.Secret

func NewService

func NewService() *corev1.Service

func NewSink added in v0.18.0

func NewSink(options ...SinkOption) runtime.Object

func SinkAddressable added in v0.18.0

func SinkAddressable(configs *config.Env) func(sink *eventing.KafkaSink)

func SinkAuthSecretRef added in v0.21.0

func SinkAuthSecretRef(name string) func(sink *eventing.KafkaSink)

func SinkConfigMapUpdatedReady added in v0.18.0

func SinkConfigMapUpdatedReady(configs *config.Env) func(sink *eventing.KafkaSink)

func SinkConfigParsed added in v0.18.0

func SinkConfigParsed(sink *eventing.KafkaSink)

func SinkControllerDontOwnTopic added in v0.18.0

func SinkControllerDontOwnTopic(sink *eventing.KafkaSink)

func SinkControllerOwnsTopic added in v0.18.0

func SinkControllerOwnsTopic(sink *eventing.KafkaSink)

func SinkDataPlaneAvailable added in v0.18.0

func SinkDataPlaneAvailable(sink *eventing.KafkaSink)

func SinkDataPlaneNotAvailable added in v0.18.0

func SinkDataPlaneNotAvailable(sink *eventing.KafkaSink)

func SinkFailedToCreateTopic added in v0.18.0

func SinkFailedToCreateTopic(sink *eventing.KafkaSink)

func SinkFailedToGetConfigMap added in v0.18.0

func SinkFailedToGetConfigMap(configs *config.Env) func(sink *eventing.KafkaSink)

func SinkReceiverPod added in v0.18.0

func SinkReceiverPod(namespace string, annotations map[string]string) runtime.Object

func SinkReceiverPodUpdate added in v0.18.0

func SinkReceiverPodUpdate(namespace string, annotations map[string]string) clientgotesting.UpdateActionImpl

func SinkTopic added in v0.18.0

func SinkTopic() string

func SinkTopicNotPresentErr added in v0.18.0

func SinkTopicNotPresentErr(topic string, err error) func(sink *eventing.KafkaSink)

func SinkTopicReady added in v0.18.0

func SinkTopicReady(sink *eventing.KafkaSink)

func SinkTopicReadyWithName added in v0.18.0

func SinkTopicReadyWithName(topic string) func(sink *eventing.KafkaSink)

func SinkTopicReadyWithOwner added in v0.18.0

func SinkTopicReadyWithOwner(topic, owner string) func(sink *eventing.KafkaSink)

func ToUnstructured added in v0.18.0

func ToUnstructured(t *testing.T, 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.

func WithBrokerConfig

func WithBrokerConfig(reference *duckv1.KReference) func(*eventing.Broker)

func WithDelivery

func WithDelivery() func(*eventing.Broker)

func WithRetry added in v0.19.0

func WithRetry(retry *int32, policy *eventingduck.BackoffPolicyType, delay *string) func(*eventing.Broker)

Types

type CMOption added in v0.21.0

type CMOption func(cm *corev1.ConfigMap)

func BrokerAuthConfig added in v0.21.0

func BrokerAuthConfig(name string) CMOption

type Ctor

type Ctor func(ctx context.Context, listers *Listers, configs *broker.Configs, row *TableRow) pkgcontroller.Reconciler

Ctor functions create a k8s controller with given params.

type Listers

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

func (*Listers) GetAllObjects

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

func (*Listers) GetBrokerLister

func (l *Listers) GetBrokerLister() eventinglisters.BrokerLister

func (*Listers) GetConfigMapLister

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

func (*Listers) GetEventingKafkaObjects added in v0.18.0

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

func (*Listers) GetEventingObjects

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

func (*Listers) GetKafkaSinkLister added in v0.18.0

func (l *Listers) GetKafkaSinkLister() eventingkafkalisters.KafkaSinkLister

func (*Listers) GetKubeObjects

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

func (*Listers) GetPodLister

func (l *Listers) GetPodLister() corelisters.PodLister

func (*Listers) GetSecretLister added in v0.21.0

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

func (*Listers) GetTriggerLister

func (l *Listers) GetTriggerLister() eventinglisters.TriggerLister

type SinkOption added in v0.18.0

type SinkOption func(sink *eventing.KafkaSink)

Jump to

Keyboard shortcuts

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