v1alpha1

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the sources/v1alpha1 API group. +k8s:deepcopy-gen=package +groupName=sources.triggermesh.io

Index

Constants

View Source
const (
	// ConditionReady has status True when the source is ready to send events.
	ConditionReady = apis.ConditionReady
	// ConditionSinkProvided has status True when the source has been configured with a sink target.
	ConditionSinkProvided apis.ConditionType = "SinkProvided"
	// ConditionDeployed has status True when the source's adapter is up and running.
	ConditionDeployed apis.ConditionType = "Deployed"
)

Status conditions

View Source
const (
	// ReasonSinkNotFound is set on a SinkProvided condition when a sink does not exist.
	ReasonSinkNotFound = "SinkNotFound"
	// ReasonSinkEmpty is set on a SinkProvided condition when a sink URI is empty.
	ReasonSinkEmpty = "EmptySinkURI"

	// ReasonUnavailable is set on a Deployed condition when an adapter in unavailable.
	ReasonUnavailable = "AdapterUnavailable"
)

Reasons for status conditions

View Source
const (
	// ZendeskReasonNoURL is set on a TargetSynced condition when the adapter URL is empty.
	ZendeskReasonNoURL = "MissingAdapterURL"
	// ZendeskReasonNoSecret is set on a TargetSynced condition when required secrets can't be obtained.
	ZendeskReasonNoSecret = "MissingSecret"
	// ZendeskReasonFailedSync is set on a TargetSynced condition when a CRUD API call returns an error.
	ZendeskReasonFailedSync = "FailedSync"
)

Reasons for status conditions

View Source
const (
	SlackGenericEventType = "com.slack.events"
)

Supported event types

View Source
const (
	// ZendeskConditionTargetSynced has status True when the Zendesk Target and Trigger have been synced.
	ZendeskConditionTargetSynced apis.ConditionType = "TargetSynced"
)

Status conditions

View Source
const (
	// ZendeskTicketCreatedEventType is generated upon creation of a Ticket.
	ZendeskTicketCreatedEventType = "com.zendesk.ticket.created"
)

Supported event types

Variables

View Source
var (
	// SchemeGroupVersion contains the group and version used to register types for this custom API.
	SchemeGroupVersion = schema.GroupVersion{Group: sources.GroupName, Version: "v1alpha1"}
	// SchemeBuilder creates a Scheme builder that is used to register types for this custom API.
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme registers the types stored in SchemeBuilder.
	AddToScheme = SchemeBuilder.AddToScheme
)

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind.

func NewEventSourceConditionSet added in v0.6.0

func NewEventSourceConditionSet(cts ...apis.ConditionType) apis.ConditionSet

NewEventSourceConditionSet returns a set of status conditions for an event source. Default conditions can be augmented by passing condition types as function arguments.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource.

func WithSource

func WithSource(ctx context.Context, s EventSource) context.Context

WithSource returns a copy of the parent context in which the value associated with the source key is the given event source.

func ZendeskSourceName

func ZendeskSourceName(subdomain, name string) string

ZendeskSourceName returns a unique reference to the source suitable for use as as a CloudEvent source.

Types

type EventSource

type EventSource interface {
	metav1.Object
	runtime.Object
	// OwnerRefable is used to construct a generic reconciler for each
	// source type, and convert source objects to owner references.
	kmeta.OwnerRefable
	// KRShaped is used by generated reconcilers to perform pre and
	// post-reconcile status updates.
	duckv1.KRShaped
	// GetSink returns the source's event sink.
	GetSink() *duckv1.Destination
	// GetStatusManager returns a manager for the source's status.
	GetStatusManager() *EventSourceStatusManager
	// GetEventTypes returns the event types generated by the source.
	GetEventTypes() []string
	// AsEventSource returns a unique reference to the source suitable for
	// use as a CloudEvent source attribute.
	AsEventSource() string
}

EventSource is implemented by all event source types.

func SourceFromContext

func SourceFromContext(ctx context.Context) EventSource

SourceFromContext returns the source stored in the context.

type EventSourceStatus

type EventSourceStatus struct {
	duckv1.SourceStatus  `json:",inline"`
	duckv1.AddressStatus `json:",inline"`
}

EventSourceStatus defines the observed state of an event source.

func (*EventSourceStatus) DeepCopy

func (in *EventSourceStatus) DeepCopy() *EventSourceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EventSourceStatus.

func (*EventSourceStatus) DeepCopyInto

func (in *EventSourceStatus) DeepCopyInto(out *EventSourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type EventSourceStatusManager added in v0.6.0

type EventSourceStatusManager struct {
	apis.ConditionSet
	*EventSourceStatus
}

EventSourceStatusManager manages the status of event sources.

+k8s:deepcopy-gen=false

func (*EventSourceStatusManager) MarkNoSink added in v0.6.0

func (m *EventSourceStatusManager) MarkNoSink()

MarkNoSink sets the SinkProvided condition to False.

func (*EventSourceStatusManager) MarkSink added in v0.6.0

func (m *EventSourceStatusManager) MarkSink(uri *apis.URL)

MarkSink sets the SinkProvided condition to True using the given URI.

func (*EventSourceStatusManager) PropagateDeploymentAvailability added in v0.6.0

func (m *EventSourceStatusManager) PropagateDeploymentAvailability(ctx context.Context,
	d *appsv1.Deployment, pi coreclientv1.PodInterface)

PropagateDeploymentAvailability uses the readiness of the provided Deployment to determine whether the Deployed condition should be marked as True or False. Given an optional PodInterface, the status of dependant Pods is inspected to generate a more meaningful failure reason in case of non-ready status of the Deployment.

func (*EventSourceStatusManager) PropagateServiceAvailability added in v0.6.0

func (m *EventSourceStatusManager) PropagateServiceAvailability(ksvc *servingv1.Service)

PropagateServiceAvailability uses the readiness of the provided Service to determine whether the Deployed condition should be marked as True or False.

type HTTPSource

type HTTPSource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   HTTPSourceSpec    `json:"spec,omitempty"`
	Status EventSourceStatus `json:"status,omitempty"`
}

HTTPSource is the schema for the event source.

func (*HTTPSource) AsEventSource

func (s *HTTPSource) AsEventSource() string

AsEventSource implements EventSource.

func (*HTTPSource) DeepCopy

func (in *HTTPSource) DeepCopy() *HTTPSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPSource.

func (*HTTPSource) DeepCopyInto

func (in *HTTPSource) DeepCopyInto(out *HTTPSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HTTPSource) DeepCopyObject

func (in *HTTPSource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*HTTPSource) GetConditionSet

func (s *HTTPSource) GetConditionSet() pkgapis.ConditionSet

GetConditionSet implements duckv1.KRShaped.

func (*HTTPSource) GetEventTypes

func (s *HTTPSource) GetEventTypes() []string

GetEventTypes implements EventSource.

func (*HTTPSource) GetGroupVersionKind

func (*HTTPSource) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable.

func (*HTTPSource) GetSink

func (s *HTTPSource) GetSink() *duckv1.Destination

GetSink implements EventSource.

func (*HTTPSource) GetStatus

func (s *HTTPSource) GetStatus() *duckv1.Status

GetStatus implements duckv1.KRShaped.

func (*HTTPSource) GetStatusManager added in v0.6.0

func (s *HTTPSource) GetStatusManager() *EventSourceStatusManager

GetStatusManager implements EventSource.

type HTTPSourceList

type HTTPSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HTTPSource `json:"items"`
}

HTTPSourceList contains a list of event sources.

func (*HTTPSourceList) DeepCopy

func (in *HTTPSourceList) DeepCopy() *HTTPSourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPSourceList.

func (*HTTPSourceList) DeepCopyInto

func (in *HTTPSourceList) DeepCopyInto(out *HTTPSourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HTTPSourceList) DeepCopyObject

func (in *HTTPSourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HTTPSourceSpec

type HTTPSourceSpec struct {
	// inherits duck/v1 SourceSpec, which currently provides:
	// * Sink - a reference to an object that will resolve to a domain name or
	//   a URI directly to use as the sink.
	// * CloudEventOverrides - defines overrides to control the output format
	//   and modifications of the event sent to the sink.
	duckv1.SourceSpec `json:",inline"`

	// EventType for the event that will be generated.
	EventType string `json:"eventType"`

	// EventSource for the event that will be generated.
	EventSource *string `json:"eventSource,omitempty"`

	// BasicAuthUsername used for basic authentication.
	// +optional
	BasicAuthUsername *string `json:"basicAuthUsername,omitempty"`

	// BasicAuthPassword used for basic authentication.
	// +optional
	BasicAuthPassword SecretValueFromSource `json:"basicAuthPassword,omitempty"`
}

HTTPSourceSpec defines the desired state of the event source.

func (*HTTPSourceSpec) DeepCopy

func (in *HTTPSourceSpec) DeepCopy() *HTTPSourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPSourceSpec.

func (*HTTPSourceSpec) DeepCopyInto

func (in *HTTPSourceSpec) DeepCopyInto(out *HTTPSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SecretValueFromSource

type SecretValueFromSource struct {
	// The Secret key to select from.
	SecretKeyRef *corev1.SecretKeySelector `json:"secretKeyRef,omitempty"`
}

SecretValueFromSource represents the source of a secret value

func (*SecretValueFromSource) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SecretValueFromSource.

func (*SecretValueFromSource) DeepCopyInto

func (in *SecretValueFromSource) DeepCopyInto(out *SecretValueFromSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SlackSource

type SlackSource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SlackSourceSpec   `json:"spec,omitempty"`
	Status EventSourceStatus `json:"status,omitempty"`
}

SlackSource is the schema for the event source.

func (*SlackSource) AsEventSource

func (s *SlackSource) AsEventSource() string

AsEventSource implements EventSource.

func (*SlackSource) DeepCopy

func (in *SlackSource) DeepCopy() *SlackSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackSource.

func (*SlackSource) DeepCopyInto

func (in *SlackSource) DeepCopyInto(out *SlackSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SlackSource) DeepCopyObject

func (in *SlackSource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*SlackSource) GetConditionSet

func (*SlackSource) GetConditionSet() pkgapis.ConditionSet

GetConditionSet implements duckv1.KRShaped.

func (*SlackSource) GetEventTypes

func (*SlackSource) GetEventTypes() []string

GetEventTypes implements EventSource.

func (*SlackSource) GetGroupVersionKind

func (*SlackSource) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable.

func (*SlackSource) GetSink

func (s *SlackSource) GetSink() *duckv1.Destination

GetSink implements EventSource.

func (*SlackSource) GetStatus

func (s *SlackSource) GetStatus() *duckv1.Status

GetStatus implements duckv1.KRShaped.

func (*SlackSource) GetStatusManager added in v0.6.0

func (s *SlackSource) GetStatusManager() *EventSourceStatusManager

GetStatusManager implements EventSource.

type SlackSourceList

type SlackSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SlackSource `json:"items"`
}

SlackSourceList contains a list of event sources.

func (*SlackSourceList) DeepCopy

func (in *SlackSourceList) DeepCopy() *SlackSourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackSourceList.

func (*SlackSourceList) DeepCopyInto

func (in *SlackSourceList) DeepCopyInto(out *SlackSourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SlackSourceList) DeepCopyObject

func (in *SlackSourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SlackSourceSpec

type SlackSourceSpec struct {
	// inherits duck/v1 SourceSpec, which currently provides:
	// * Sink - a reference to an object that will resolve to a domain name or
	//   a URI directly to use as the sink.
	// * CloudEventOverrides - defines overrides to control the output format
	//   and modifications of the event sent to the sink.
	duckv1.SourceSpec `json:",inline"`

	// SigningSecret can be set to the value of Slack request signing secret
	// to authenticate callbacks.
	// See: https://api.slack.com/authentication/verifying-requests-from-slack
	// +optional
	SigningSecret *SecretValueFromSource `json:"signingSecret,omitempty"`

	// AppID identifies the Slack application generating this event.
	// It helps identifying the App sourcing events when multiple Slack
	// applications shared an endpoint. See: https://api.slack.com/events-api
	// +optional
	AppID *string `json:"appID,omitempty"`
}

SlackSourceSpec defines the desired state of the event source.

func (*SlackSourceSpec) DeepCopy

func (in *SlackSourceSpec) DeepCopy() *SlackSourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlackSourceSpec.

func (*SlackSourceSpec) DeepCopyInto

func (in *SlackSourceSpec) DeepCopyInto(out *SlackSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ValueFromField

type ValueFromField struct {

	// Field value.
	// +optional
	Value string `json:"value,omitempty"`
	// Field value from a Kubernetes Secret.
	// +optional
	ValueFromSecret *corev1.SecretKeySelector `json:"valueFromSecret,omitempty"`
}

ValueFromField is a struct field that can have its value either defined explicitly or sourced from another entity.

func (*ValueFromField) DeepCopy

func (in *ValueFromField) DeepCopy() *ValueFromField

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ValueFromField.

func (*ValueFromField) DeepCopyInto

func (in *ValueFromField) DeepCopyInto(out *ValueFromField)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ZendeskSource

type ZendeskSource struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   ZendeskSourceSpec   `json:"spec,omitempty"`
	Status ZendeskSourceStatus `json:"status,omitempty"`
}

ZendeskSource is the schema for the event source.

func (*ZendeskSource) AsEventSource

func (s *ZendeskSource) AsEventSource() string

AsEventSource implements EventSource.

func (*ZendeskSource) DeepCopy

func (in *ZendeskSource) DeepCopy() *ZendeskSource

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZendeskSource.

func (*ZendeskSource) DeepCopyInto

func (in *ZendeskSource) DeepCopyInto(out *ZendeskSource)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ZendeskSource) DeepCopyObject

func (in *ZendeskSource) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*ZendeskSource) GetConditionSet

func (*ZendeskSource) GetConditionSet() apis.ConditionSet

GetConditionSet implements duckv1.KRShaped.

func (*ZendeskSource) GetEventTypes

func (*ZendeskSource) GetEventTypes() []string

GetEventTypes implements EventSource.

func (*ZendeskSource) GetGroupVersionKind

func (*ZendeskSource) GetGroupVersionKind() schema.GroupVersionKind

GetGroupVersionKind implements kmeta.OwnerRefable.

func (*ZendeskSource) GetSink

func (s *ZendeskSource) GetSink() *duckv1.Destination

GetSink implements EventSource.

func (*ZendeskSource) GetStatus

func (s *ZendeskSource) GetStatus() *duckv1.Status

GetStatus implements duckv1.KRShaped.

func (*ZendeskSource) GetStatusManager added in v0.6.0

func (s *ZendeskSource) GetStatusManager() *EventSourceStatusManager

GetStatusManager implements EventSource.

func (*ZendeskSource) GetUntypedSpec

func (s *ZendeskSource) GetUntypedSpec() interface{}

GetUntypedSpec implements apis.HasSpec.

type ZendeskSourceList

type ZendeskSourceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []ZendeskSource `json:"items"`
}

ZendeskSourceList contains a list of event sources.

func (*ZendeskSourceList) DeepCopy

func (in *ZendeskSourceList) DeepCopy() *ZendeskSourceList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZendeskSourceList.

func (*ZendeskSourceList) DeepCopyInto

func (in *ZendeskSourceList) DeepCopyInto(out *ZendeskSourceList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ZendeskSourceList) DeepCopyObject

func (in *ZendeskSourceList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ZendeskSourceSpec

type ZendeskSourceSpec struct {
	// inherits duck/v1 SourceSpec, which currently provides:
	// * Sink - a reference to an object that will resolve to a domain name or
	//   a URI directly to use as the sink.
	// * CloudEventOverrides - defines overrides to control the output format
	//   and modifications of the event sent to the sink.
	duckv1.SourceSpec `json:",inline"`

	// Token identifies the API token used for creating the proper credentials to interface with Zendesk
	// allowing the source to auto-register the webhook to authenticate callbacks.
	Token SecretValueFromSource `json:"token,omitempty"`

	// Email identifies the email used for creating the proper credentials to interface with Zendesk
	// allowing the source to auto-register the webhook to authenticate callbacks.
	Email string `json:"email,omitempty"`

	// WebhookPassword used for basic authentication for events sent from Zendesk
	// to the adapter.
	WebhookPassword SecretValueFromSource `json:"webhookPassword,omitempty"`

	// WebhookUsername used for basic authentication for events sent from Zendesk
	// to the adapter.
	WebhookUsername string `json:"webhookUsername,omitempty"`

	// Subdomain identifies Zendesk subdomain
	Subdomain string `json:"subdomain,omitempty"`
}

ZendeskSourceSpec defines the desired state of the event source.

func (*ZendeskSourceSpec) DeepCopy

func (in *ZendeskSourceSpec) DeepCopy() *ZendeskSourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZendeskSourceSpec.

func (*ZendeskSourceSpec) DeepCopyInto

func (in *ZendeskSourceSpec) DeepCopyInto(out *ZendeskSourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ZendeskSourceStatus

type ZendeskSourceStatus struct {
	EventSourceStatus `json:",inline"`
}

ZendeskSourceStatus defines the observed state of the event source.

func (*ZendeskSourceStatus) DeepCopy

func (in *ZendeskSourceStatus) DeepCopy() *ZendeskSourceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ZendeskSourceStatus.

func (*ZendeskSourceStatus) DeepCopyInto

func (in *ZendeskSourceStatus) DeepCopyInto(out *ZendeskSourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ZendeskSourceStatus) MarkTargetNotSynced

func (s *ZendeskSourceStatus) MarkTargetNotSynced(reason, msg string)

MarkTargetNotSynced sets the TargetSynced condition to False with the given reason and associated message.

func (*ZendeskSourceStatus) MarkTargetSynced

func (s *ZendeskSourceStatus) MarkTargetSynced()

MarkTargetSynced sets the TargetSynced condition to True.

Jump to

Keyboard shortcuts

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