Documentation ¶
Index ¶
- Constants
- Variables
- func BrokerV1(name string, options ...BrokerV1Option) *eventingv1.Broker
- func BrokerV1Beta1(name string, options ...BrokerV1Beta1Option) *eventingv1beta1.Broker
- func ClusterRoleBinding(saName, saNamespace, crName, crbName string) *rbacv1.ClusterRoleBinding
- func ConfigMap(name, namespace string, data map[string]string) *corev1.ConfigMap
- func Delivery(options ...DeliveryOption) *eventingduckv1beta1.DeliverySpec
- func EventFilteringPod(name string, filter bool) *corev1.Pod
- func EventRecordPod(name string) *corev1.Pod
- func EventTransformationPod(name string, newEventType string, newEventSource string, newEventData []byte) *corev1.Pod
- func HelloWorldPod(name string, options ...PodOption) *corev1.Pod
- func KServiceDeploymentName(client ServingClient, name, namespace string) (string, bool, error)
- func KServiceRef(name string) *corev1.ObjectReference
- func KnativeRefForBroker(name, namespace string) *duckv1.KReference
- func KnativeRefForKservice(name, namespace string) *duckv1.KReference
- func KnativeRefForService(name, namespace string) *duckv1.KReference
- func PerformanceAggregatorService() *corev1.Service
- func PerformanceConsumerService() *corev1.Service
- func PerformanceImageAggregatorPod(expectedRecords int, publish bool, additionalArgs ...string) *corev1.Pod
- func PerformanceImageReceiverPod(imageName string, pace string, warmup string, aggregatorHostname string, ...) *corev1.Pod
- func Role(rName string, options ...RoleOption) *rbacv1.Role
- func RoleBinding(saName, saNamespace, rKind, rName, rbName, rbNamespace string) *rbacv1.RoleBinding
- func SequenceStepperPod(name, eventMsgAppender string) *corev1.Pod
- func Service(name string, selector map[string]string, ports []corev1.ServicePort) *corev1.Service
- func ServiceAccount(name, namespace string) *corev1.ServiceAccount
- func ServiceDefaultHTTP(name string, selector map[string]string) *corev1.Service
- func ServiceKRef(name string) *v1.KReference
- func ServiceRef(name string) *corev1.ObjectReference
- func SubscriptionV1(name, channelName string, channelTypeMeta *metav1.TypeMeta, ...) *messagingv1.Subscription
- func SubscriptionV1Beta1(name, channelName string, channelTypeMeta *metav1.TypeMeta, ...) *messagingv1beta1.Subscription
- func TriggerV1(name string, options ...TriggerOptionV1) *eventingv1.Trigger
- func TriggerV1Beta1(name string, options ...TriggerOptionV1Beta1) *eventingv1beta1.Trigger
- type BrokerV1Beta1Option
- func WithBrokerClassForBrokerV1Beta1(brokerClass string) BrokerV1Beta1Option
- func WithConfigForBrokerV1Beta1(config *duckv1.KReference) BrokerV1Beta1Option
- func WithConfigMapForBrokerConfig() BrokerV1Beta1Option
- func WithDeliveryForBrokerV1Beta1(delivery *eventingduckv1beta1.DeliverySpec) BrokerV1Beta1Option
- type BrokerV1Option
- type DeliveryOption
- type KServiceRoute
- type MetaResource
- type MetaResourceList
- type PodOption
- type RoleOption
- type ServingClient
- type SubscriptionOptionV1
- type SubscriptionOptionV1Beta1
- type TriggerOptionV1
- type TriggerOptionV1Beta1
- func WithAttributesTriggerFilterV1Beta1(eventSource, eventType string, extensions map[string]interface{}) TriggerOptionV1Beta1
- func WithBrokerV1Beta1(name string) TriggerOptionV1Beta1
- func WithDependencyAnnotationTriggerV1Beta1(dependencyAnnotation string) TriggerOptionV1Beta1
- func WithSubscriberKServiceRefForTrigger(name string) TriggerOptionV1Beta1
- func WithSubscriberServiceRefForTriggerV1Beta1(name string) TriggerOptionV1Beta1
- func WithSubscriberURIForTriggerV1Beta1(uri string) TriggerOptionV1Beta1
Constants ¶
const ( CoreAPIVersion = "v1" EventingAPIVersion = "eventing.knative.dev/v1beta1" MessagingAPIVersion = "messaging.knative.dev/v1beta1" FlowsAPIVersion = "flows.knative.dev/v1beta1" ServingAPIVersion = "serving.knative.dev/v1" SourcesV1A2APIVersion = "sources.knative.dev/v1alpha2" SourcesV1B1APIVersion = "sources.knative.dev/v1beta1" )
API versions for the resources.
const ( SubscriptionKind string = "Subscription" BrokerKind string = "Broker" TriggerKind string = "Trigger" )
Kind for eventing resources.
const ( InMemoryChannelKind string = "InMemoryChannel" ChannelKind string = "Channel" SequenceKind string = "Sequence" ParallelKind string = "Parallel" )
Kind for messaging resources.
const ( FlowsSequenceKind string = "Sequence" FlowsParallelKind string = "Parallel" )
Kind for flows resources.
const ( ApiServerSourceKind string = "ApiServerSource" PingSourceKind string = "PingSource" )
Kind for sources resources that exist in Eventing core
const ( PerfConsumerService = "perf-consumer" PerfAggregatorService = "perf-aggregator" PerfServiceAccount = "perf-eventing" )
const (
KServiceKind string = "Service"
)
Kind for Knative resources.
const (
ServiceKind string = "Service"
)
Kind for core Kubernetes resources.
Variables ¶
var ( // KServicesGVR is GroupVersionResource for Knative Service KServicesGVR = schema.GroupVersionResource{ Group: "serving.knative.dev", Version: "v1", Resource: "services", } // KServiceType is type of Knative Service KServiceType = metav1.TypeMeta{ Kind: "Service", APIVersion: KServicesGVR.GroupVersion().String(), } )
var SystemNamespace = getenv("TEST_EVENTING_NAMESPACE", "knative-eventing")
SystemNamespace is the namespace where Eventing is installed, it's default to be knative-eventing.
Functions ¶
func BrokerV1 ¶ added in v0.16.0
func BrokerV1(name string, options ...BrokerV1Option) *eventingv1.Broker
BrokerV1 returns a v1 Broker.
func BrokerV1Beta1 ¶ added in v0.13.0
func BrokerV1Beta1(name string, options ...BrokerV1Beta1Option) *eventingv1beta1.Broker
BrokerV1Beta1 returns a v1beta1 Broker.
func ClusterRoleBinding ¶
func ClusterRoleBinding(saName, saNamespace, crName, crbName string) *rbacv1.ClusterRoleBinding
ClusterRoleBinding creates a Kubernetes ClusterRoleBinding with the given ServiceAccount name and namespace, ClusterRole name, ClusterRoleBinding name.
func Delivery ¶
func Delivery(options ...DeliveryOption) *eventingduckv1beta1.DeliverySpec
Delivery returns a DeliverySpec.
func EventFilteringPod ¶
EventFilteringPod creates a Pod that either filter or send the received CloudEvent
func EventRecordPod ¶ added in v0.14.0
EventRecordPod creates a Pod that stores received events for test retrieval.
func EventTransformationPod ¶
func EventTransformationPod(name string, newEventType string, newEventSource string, newEventData []byte) *corev1.Pod
EventTransformationPod creates a Pod that transforms events received receiving as arg a cloudevents sdk2 Event
func HelloWorldPod ¶
HelloWorldPod creates a Pod that logs "Hello, World!".
func KServiceDeploymentName ¶ added in v0.15.0
func KServiceDeploymentName(client ServingClient, name, namespace string) (string, bool, error)
KServiceDeploymentName returns a name of deployment of Knative Service that receives 100% of traffic. If ksvc isn't ready yet second return value will be false.
func KServiceRef ¶
func KServiceRef(name string) *corev1.ObjectReference
KServiceRef returns a Knative Service ObjectReference for a given Service name.
func KnativeRefForBroker ¶ added in v0.14.0
func KnativeRefForBroker(name, namespace string) *duckv1.KReference
func KnativeRefForKservice ¶ added in v0.15.0
func KnativeRefForKservice(name, namespace string) *duckv1.KReference
KnativeRefForKservice return a duck reference for Knative Service
func KnativeRefForService ¶ added in v0.13.0
func KnativeRefForService(name, namespace string) *duckv1.KReference
func Role ¶
func Role(rName string, options ...RoleOption) *rbacv1.Role
EventWatcherRole creates a Kubernetes Role
func RoleBinding ¶
func RoleBinding(saName, saNamespace, rKind, rName, rbName, rbNamespace string) *rbacv1.RoleBinding
RoleBinding creates a Kubernetes RoleBinding with the given ServiceAccount name and namespace, Role or ClusterRole Kind, name, RoleBinding name and namespace.
func SequenceStepperPod ¶
SequenceStepperPod creates a Pod that can be used as a step in testing Sequence. Note event data used in the test must be BaseData, and this Pod as a Subscriber will receive the event, and return a new event with eventMsgAppender added to data.Message.
func ServiceAccount ¶
func ServiceAccount(name, namespace string) *corev1.ServiceAccount
ServiceAccount creates a Kubernetes ServiceAccount with the given name and namespace.
func ServiceDefaultHTTP ¶
Service creates a Kubernetes Service with the given name, namespace, and selector. Port 8080 is set as the target port.
func ServiceKRef ¶ added in v0.14.0
func ServiceKRef(name string) *v1.KReference
ServiceKRef returns a Service ObjectReference for a given Service name.
func ServiceRef ¶
func ServiceRef(name string) *corev1.ObjectReference
ServiceRef returns a Service ObjectReference for a given Service name.
func SubscriptionV1 ¶ added in v0.16.0
func SubscriptionV1( name, channelName string, channelTypeMeta *metav1.TypeMeta, options ...SubscriptionOptionV1, ) *messagingv1.Subscription
SubscriptionV1 returns a v1 Subscription.
func SubscriptionV1Beta1 ¶ added in v0.13.0
func SubscriptionV1Beta1( name, channelName string, channelTypeMeta *metav1.TypeMeta, options ...SubscriptionOptionV1Beta1, ) *messagingv1beta1.Subscription
SubscriptionV1Beta1 returns a v1beta1 Subscription.
func TriggerV1 ¶ added in v0.16.0
func TriggerV1(name string, options ...TriggerOptionV1) *eventingv1.Trigger
TriggerV1 returns a v1 Trigger.
func TriggerV1Beta1 ¶ added in v0.13.0
func TriggerV1Beta1(name string, options ...TriggerOptionV1Beta1) *eventingv1beta1.Trigger
TriggerV1Beta1 returns a v1beta1 Trigger.
Types ¶
type BrokerV1Beta1Option ¶ added in v0.13.0
type BrokerV1Beta1Option func(*eventingv1beta1.Broker)
BrokerV1Beta1Option enables further configuration of a v1beta1 Broker.
func WithBrokerClassForBrokerV1Beta1 ¶ added in v0.14.0
func WithBrokerClassForBrokerV1Beta1(brokerClass string) BrokerV1Beta1Option
WithBrokerClassForBrokerV1Beta1 returns a function that adds a brokerClass annotation to the given Broker.
func WithConfigForBrokerV1Beta1 ¶ added in v0.15.0
func WithConfigForBrokerV1Beta1(config *duckv1.KReference) BrokerV1Beta1Option
func WithConfigMapForBrokerConfig ¶ added in v0.15.0
func WithConfigMapForBrokerConfig() BrokerV1Beta1Option
WithConfigMapForBrokerConfig returns a function that configures the ConfigMap for the Spec.Config for a given Broker. Note that the CM must exist and has to be in the same namespace as the Broker and have the same Name. Typically you'd do this by calling client.CreateBrokerConfigMapOrFail and then call this method. If those don't apply to your ConfigMap, look at WithConfigForBrokerV1Beta1
func WithDeliveryForBrokerV1Beta1 ¶ added in v0.15.0
func WithDeliveryForBrokerV1Beta1(delivery *eventingduckv1beta1.DeliverySpec) BrokerV1Beta1Option
WithDeliveryForBrokerV1Beta1 returns a function that adds a Delivery for the given v1beta1 Broker.
type BrokerV1Option ¶ added in v0.16.0
type BrokerV1Option func(*eventingv1.Broker)
BrokerV1Option enables further configuration of a v1 Broker.
func WithBrokerClassForBrokerV1 ¶ added in v0.16.0
func WithBrokerClassForBrokerV1(brokerClass string) BrokerV1Option
WithBrokerClassForBrokerV1 returns a function that adds a brokerClass annotation to the given v1 Broker.
func WithConfigForBrokerV1 ¶ added in v0.16.0
func WithConfigForBrokerV1(config *duckv1.KReference) BrokerV1Option
func WithDeliveryForBrokerV1 ¶ added in v0.16.0
func WithDeliveryForBrokerV1(delivery *eventingduckv1.DeliverySpec) BrokerV1Option
WithDeliveryForBrokerV1 returns a function that adds a Delivery for the given v1 Broker.
type DeliveryOption ¶
type DeliveryOption func(*eventingduckv1beta1.DeliverySpec)
DeliveryOption enables further configuration of DeliverySpec.
func WithDeadLetterSinkForDelivery ¶
func WithDeadLetterSinkForDelivery(name string) DeliveryOption
WithDeadLetterSinkForDelivery returns an options that adds a DeadLetterSink for the given DeliverySpec.
type KServiceRoute ¶ added in v0.15.0
KServiceRoute represents ksvc route, so how much traffic is routed to given deployment
func KServiceRoutes ¶ added in v0.15.0
func KServiceRoutes(client ServingClient, name, namespace string) ([]KServiceRoute, bool, error)
KServiceRoutes gets routes of given ksvc. If ksvc isn't ready yet second return value will be false.
type MetaResource ¶
type MetaResource struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` }
MetaResource includes necessary meta data to retrieve the generic Kubernetes resource.
func NewMetaResource ¶
func NewMetaResource(name, namespace string, typemeta *metav1.TypeMeta) *MetaResource
NewMetaResource returns a MetaResource built from the given name, namespace and typemeta.
type MetaResourceList ¶
MetaResourceList includes necessary meta data to retrieve the generic Kubernetes resource list.
func NewMetaResourceList ¶
func NewMetaResourceList(namespace string, typemeta *metav1.TypeMeta) *MetaResourceList
NewMetaResourceList returns a MetaResourceList built from the given namespace and typemeta.
type PodOption ¶
PodOption enables further configuration of a Pod.
func WithLabelsForPod ¶
WithLabelsForPod returns an option setting the pod labels
type RoleOption ¶
Option enables further configuration of a Role.
func WithRuleForRole ¶
func WithRuleForRole(rule *rbacv1.PolicyRule) RoleOption
WithRuleForRole is a Role Option for adding a rule
type ServingClient ¶ added in v0.15.0
type ServingClient struct { Kube *pkgTest.KubeClient Dynamic dynamic.Interface }
ServingClient holds clients required to get serving resources
type SubscriptionOptionV1 ¶ added in v0.16.0
type SubscriptionOptionV1 func(*messagingv1.Subscription)
SubscriptionOptionV1 enables further configuration of a v1 Subscription.
func WithDeadLetterSinkForSubscriptionV1 ¶ added in v0.16.0
func WithDeadLetterSinkForSubscriptionV1(name string) SubscriptionOptionV1
WithDeadLetterSinkForSubscriptionV1 returns an options that adds a DeadLetterSink for the given v1 Subscription.
func WithReplyForSubscriptionV1 ¶ added in v0.16.0
func WithReplyForSubscriptionV1(name string, typemeta *metav1.TypeMeta) SubscriptionOptionV1
WithReplyForSubscriptionV1 returns an options that adds a ReplyStrategy for the given v1 Subscription.
func WithSubscriberForSubscriptionV1 ¶ added in v0.16.0
func WithSubscriberForSubscriptionV1(name string) SubscriptionOptionV1
WithSubscriberForSubscriptionV1 returns an option that adds a Subscriber for the given v1 Subscription.
type SubscriptionOptionV1Beta1 ¶ added in v0.13.0
type SubscriptionOptionV1Beta1 func(*messagingv1beta1.Subscription)
SubscriptionOptionV1Beta1 enables further configuration of a v1beta1 Subscription.
func WithDeadLetterSinkForSubscription ¶
func WithDeadLetterSinkForSubscription(name string) SubscriptionOptionV1Beta1
WithDeadLetterSinkForSubscription returns an options that adds a DeadLetterSink for the given Subscription.
func WithReplyForSubscription ¶
func WithReplyForSubscription(name string, typemeta *metav1.TypeMeta) SubscriptionOptionV1Beta1
WithReplyForSubscription returns an options that adds a ReplyStrategy for the given Subscription.
func WithSubscriberForSubscription ¶
func WithSubscriberForSubscription(name string) SubscriptionOptionV1Beta1
WithSubscriberForSubscription returns an option that adds a Subscriber for the given v1beta1 Subscription.
type TriggerOptionV1 ¶ added in v0.16.0
type TriggerOptionV1 func(*eventingv1.Trigger)
TriggerOptionV1 enables further configuration of a v1 Trigger.
func WithAttributesTriggerFilterV1 ¶ added in v0.16.0
func WithAttributesTriggerFilterV1(eventSource, eventType string, extensions map[string]interface{}) TriggerOptionV1
WithAttributesTriggerFilter returns an option that adds a TriggerFilter with Attributes for the given Trigger.
func WithBrokerV1 ¶ added in v0.16.0
func WithBrokerV1(name string) TriggerOptionV1
WithBrokerV1 returns an option that adds a broker for the given Trigger.
func WithSubscriberServiceRefForTriggerV1 ¶ added in v0.16.0
func WithSubscriberServiceRefForTriggerV1(name string) TriggerOptionV1
WithSubscriberServiceRefForTriggerV1 returns an option that adds a Subscriber Knative Service Ref for the given v1 Trigger.
func WithSubscriberURIForTriggerV1 ¶ added in v0.16.0
func WithSubscriberURIForTriggerV1(uri string) TriggerOptionV1
WithSubscriberURIForTriggerV1 returns an option that adds a Subscriber URI for the given v1 Trigger.
type TriggerOptionV1Beta1 ¶ added in v0.13.0
type TriggerOptionV1Beta1 func(*eventingv1beta1.Trigger)
TriggerOptionV1Beta1 enables further configuration of a v1beta1 Trigger.
func WithAttributesTriggerFilterV1Beta1 ¶ added in v0.13.0
func WithAttributesTriggerFilterV1Beta1(eventSource, eventType string, extensions map[string]interface{}) TriggerOptionV1Beta1
WithAttributesTriggerFilter returns an option that adds a TriggerFilter with Attributes for the given Trigger.
func WithBrokerV1Beta1 ¶ added in v0.15.0
func WithBrokerV1Beta1(name string) TriggerOptionV1Beta1
WithBrokerV1Beta1 returns an option that adds a broker for the given Trigger.
func WithDependencyAnnotationTriggerV1Beta1 ¶ added in v0.13.1
func WithDependencyAnnotationTriggerV1Beta1(dependencyAnnotation string) TriggerOptionV1Beta1
WithDependencyAnnotationTrigger returns an option that adds a dependency annotation to the given Trigger.
func WithSubscriberKServiceRefForTrigger ¶
func WithSubscriberKServiceRefForTrigger(name string) TriggerOptionV1Beta1
WithSubscriberKServiceRefForTrigger returns an option that adds a Subscriber Knative Service Ref for the given Trigger.
func WithSubscriberServiceRefForTriggerV1Beta1 ¶ added in v0.13.0
func WithSubscriberServiceRefForTriggerV1Beta1(name string) TriggerOptionV1Beta1
WithSubscriberServiceRefForTriggerV1Beta1 returns an option that adds a Subscriber Knative Service Ref for the given v1beta1 Trigger.
func WithSubscriberURIForTriggerV1Beta1 ¶ added in v0.16.0
func WithSubscriberURIForTriggerV1Beta1(uri string) TriggerOptionV1Beta1
WithSubscriberURIForTriggerV1Beta1 returns an option that adds a Subscriber URI for the given v1beta1 Trigger.