Documentation ¶
Overview ¶
Package common contains constants shared by reconcilers.
Index ¶
Constants ¶
const ( EnvName = "NAME" EnvNamespace = "NAMESPACE" EnvSink = "K_SINK" EnvMetricsPrometheusPort = "METRICS_PROMETHEUS_PORT" )
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 = "knative-sources" ManagedBy = "knative-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 ¶
func CreateCloudEventAttributes(source string, eventTypes []string) []duckv1.CloudEventAttributes
CreateCloudEventAttributes returns CloudEvent attributes for the event types supported by the source.
Types ¶
type AdapterDeploymentBuilderFunc ¶
type AdapterDeploymentBuilderFunc func(sinkURI *apis.URL) *appsv1.Deployment
AdapterDeploymentBuilderFunc builds a Deployment object for a source's adapter.
type AdapterServiceBuilderFunc ¶
AdapterServiceBuilderFunc builds a Service 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.
type GenericServiceReconciler ¶
type GenericServiceReconciler struct { // URI resolver for sinks SinkResolver *resolver.URIResolver // API clients Client func(namespace string) servingclientv1.ServiceInterface // objects listers Lister func(namespace string) servinglistersv1.ServiceNamespaceLister }
GenericServiceReconciler contains interfaces shared across Service reconcilers.
func NewGenericServiceReconciler ¶
func NewGenericServiceReconciler(ctx context.Context, gvk schema.GroupVersionKind, resolverCallback func(types.NamespacedName), adapterHandlerFn func(obj interface{}), ) GenericServiceReconciler
NewGenericServiceReconciler creates a new GenericServiceReconciler and attaches a default event handler to its Service informer.
func (*GenericServiceReconciler) FindAdapter ¶ added in v0.5.0
func (r *GenericServiceReconciler) FindAdapter(src v1alpha1.EventSource) (*servingv1.Service, error)
FindAdapter returns the adapter Service for a given source if it exists.
func (*GenericServiceReconciler) ReconcileSource ¶
func (r *GenericServiceReconciler) ReconcileSource(ctx context.Context, adb AdapterServiceBuilderFunc) 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. |