Documentation ¶
Overview ¶
Package common contains constants shared by reconcilers.
Index ¶
Constants ¶
const ( // Knative attributes EnvName = "NAME" EnvNamespace = "NAMESPACE" EnvSink = "K_SINK" // Common Azure attributes EnvTenantID = "AZURE_TENANT_ID" EnvClientID = "AZURE_CLIENT_ID" EnvClientSecret = "AZURE_CLIENT_SECRET" EnvConnStr = "AZURE_CONN_STR" // Azure EventHub auth attributes EnvHubName = "AZURE_HUB_NAME" EnvHubNamespace = "AZURE_HUB_NAMESPACE" EnvHubKeyName = "EVENTHUB_KEY_NAME" EnvHubKeyValue = "EVENTHUB_KEY_VALUE" // Bridge identifier for stateful flows EnvBridgeIdentifier = "BRIDGE_IDENTIFIER" )
Common environment variables propagated to adapters.
const ( // ReasonAdapterCreate indicates that an adapter object was successfully created. ReasonAdapterCreate = "CreateAdapter" // ReasonAdapterUpdate indicates that an adapter object was successfully updated. ReasonAdapterUpdate = "UpdateAdapter" // ReasonFailedAdapterCreate indicates that the creation of an adapter object failed. ReasonFailedAdapterCreate = "FailedAdapterCreate" // ReasonFailedAdapterUpdate indicates that the update of an adapter object failed. ReasonFailedAdapterUpdate = "FailedAdapterUpdate" // ReasonBadSinkURI indicates that the URI of a sink can't be determined. ReasonBadSinkURI = "BadSinkURI" // ReasonInvalidSpec indicates that spec of a reconciled object is invalid. ReasonInvalidSpec = "InvalidSpec" )
Reasons for API Events
const ( // AppNameLabel is the name of the application. AppNameLabel = "app.kubernetes.io/name" // AppInstanceLabel is a unique name identifying the instance of an application. AppInstanceLabel = "app.kubernetes.io/instance" // AppVersionLabel is the current version of the application. AppVersionLabel = "app.kubernetes.io/version" // AppComponentLabel is the component within the architecture. AppComponentLabel = "app.kubernetes.io/component" // AppPartOfLabel is the name of a higher level application this one is part of. AppPartOfLabel = "app.kubernetes.io/part-of" // AppManagedByLabel is the tool being used to manage the operation of an application. AppManagedByLabel = "app.kubernetes.io/managed-by" )
Kubernetes recommended labels https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/
const ( PartOf = "event-sources" ManagedBy = "event-sources-controller" AdapterComponent = "adapter" )
Common label values
Variables ¶
This section is empty.
Functions ¶
func AdapterName ¶ added in v0.5.0
func AdapterName(o kmeta.OwnerRefable) string
AdapterName returns the adapter's name for the given source object.
func CreateCloudEventAttributes ¶ added in v0.4.1
func CreateCloudEventAttributes(source string, eventTypes []string) []duckv1.CloudEventAttributes
CreateCloudEventAttributes returns CloudEvent attributes for the event types supported by the source.
func GetStatefulBridgeID ¶ added in v1.1.0
GetStatefulBridgeID returns the BridgeID based on an object metadata.
All bridge components controlled by Triggerflow have labels informing their relation with the bridges they are part of. A component can only have one dominant bridge, which is the one it synchronizes with. This function uses that label to retrieve the bridge name and use it as unique ID.
Types ¶
type AdapterDeploymentBuilderFunc ¶
type AdapterDeploymentBuilderFunc func(sinkURI *apis.URL) *appsv1.Deployment
AdapterDeploymentBuilderFunc builds a Deployment object for a source's adapter.
type GenericDeploymentReconciler ¶
type GenericDeploymentReconciler struct { // URI resolver for sinks SinkResolver *resolver.URIResolver // API clients Client func(namespace string) appsclientv1.DeploymentInterface PodClient func(namespace string) coreclientv1.PodInterface // objects listers Lister func(namespace string) appslistersv1.DeploymentNamespaceLister }
GenericDeploymentReconciler contains interfaces shared across Deployment reconcilers.
func NewGenericDeploymentReconciler ¶
func NewGenericDeploymentReconciler(ctx context.Context, gvk schema.GroupVersionKind, resolverCallback func(types.NamespacedName), adapterHandlerFn func(obj interface{}), ) GenericDeploymentReconciler
NewGenericDeploymentReconciler creates a new GenericDeploymentReconciler and attaches a default event handler to its Deployment informer.
func (*GenericDeploymentReconciler) FindAdapter ¶ added in v0.5.0
func (r *GenericDeploymentReconciler) FindAdapter(src v1alpha1.EventSource) (*appsv1.Deployment, error)
FindAdapter returns the adapter Deployment for a given source if it exists.
func (*GenericDeploymentReconciler) ReconcileSource ¶
func (r *GenericDeploymentReconciler) ReconcileSource(ctx context.Context, adb AdapterDeploymentBuilderFunc) reconciler.Event
ReconcileSource reconciles an event source type.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package event contains functions for generating Kubernetes API events.
|
Package event contains functions for generating Kubernetes API events. |
Package resource contains helpers to generate Kubernetes API objects.
|
Package resource contains helpers to generate Kubernetes API objects. |
Package skip allows a Context to carry the intention to skip parts of the code execution.
|
Package skip allows a Context to carry the intention to skip parts of the code execution. |