Documentation ¶
Overview ¶
Package v1alpha1 contains interfaces and types common to all TriggerMesh API groups.
Index ¶
- Constants
- Variables
- func AwsIamRoleAnnotation(iamRole apis.ARN) resource.ServiceAccountOption
- func IsMultiTenant(r Reconcilable) bool
- func NewConditionSet(cts ...apis.ConditionType) apis.ConditionSet
- func ServiceAccountAnnotationsFromContext(ctx context.Context) map[string]string
- func ServiceAccountOptions(r Reconcilable) []resource.ServiceAccountOption
- func WantsOwnServiceAccount(r Reconcilable) bool
- func WithReconcilable(ctx context.Context, r Reconcilable) context.Context
- func WithServiceAccountAnnotated(ctx context.Context, annotations map[string]string) context.Context
- type AWSAuth
- type AWSEndpoint
- type AWSSecurityCredentials
- type AdapterConfigurable
- type AdapterOverrides
- type CloudEventStatus
- type EventReceiver
- type EventSender
- type EventSource
- type MultiTenant
- type Reconcilable
- type ServiceAccountProvider
- type Status
- type StatusManager
- func (m *StatusManager) MarkNoSink()
- func (m *StatusManager) MarkRBACNotBound()
- func (m *StatusManager) MarkSink(uri *apis.URL)
- func (m *StatusManager) PropagateDeploymentAvailability(ctx context.Context, d *appsv1.Deployment, pl corelistersv1.PodNamespaceLister)
- func (m *StatusManager) PropagateServiceAvailability(ksvc *servingv1.Service)
- func (m *StatusManager) SetRoute(urlPath string)
- type ValueFromField
Constants ¶
const ( // ConditionReady has status True when the component is ready to receive/send events. ConditionReady = apis.ConditionReady // ConditionSinkProvided has status True when the component has been configured with an event sink. ConditionSinkProvided apis.ConditionType = "SinkProvided" // ConditionDeployed has status True when the component's adapter is up and running. ConditionDeployed apis.ConditionType = "Deployed" )
Status conditions
const ( // ReasonRBACNotBound is set on a Deployed condition when an adapter's // ServiceAccount cannot be bound. ReasonRBACNotBound = "RBACNotBound" ReasonUnavailable = "AdapterUnavailable" // 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" )
Reasons for status conditions
Variables ¶
var DefaultConditionSet = NewConditionSet()
DefaultConditionSet is a generic set of status conditions used by default in all components.
var EventSenderConditionSet = NewConditionSet( ConditionSinkProvided, )
EventSenderConditionSet is a set of conditions for instances that send events to a sink.
Functions ¶
func AwsIamRoleAnnotation ¶ added in v1.23.0
func AwsIamRoleAnnotation(iamRole apis.ARN) resource.ServiceAccountOption
AwsIamRoleAnnotation returns a functional option that sets the EKS role-arn annotation on a ServiceAccount.
func IsMultiTenant ¶
func IsMultiTenant(r Reconcilable) bool
IsMultiTenant returns whether the given component type is multi-tenant.
func NewConditionSet ¶
func NewConditionSet(cts ...apis.ConditionType) apis.ConditionSet
NewConditionSet returns a set of status conditions for a component type. Default conditions can be augmented by passing condition types as function arguments.
func ServiceAccountAnnotationsFromContext ¶ added in v1.22.0
func ServiceAccountOptions ¶
func ServiceAccountOptions(r Reconcilable) []resource.ServiceAccountOption
ServiceAccountOptions returns functional options for mutating the ServiceAccount associated with a given component instance.
func WantsOwnServiceAccount ¶
func WantsOwnServiceAccount(r Reconcilable) bool
WantsOwnServiceAccount returns whether the given component instance should have a dedicated ServiceAccount associated with its receive adapter.
func WithReconcilable ¶
func WithReconcilable(ctx context.Context, r Reconcilable) context.Context
WithReconcilable returns a copy of the parent context in which the value associated with the reconcilableInstanceKey is the given component instance.
Types ¶
type AWSAuth ¶ added in v1.23.0
type AWSAuth struct { // Security credentials allow AWS to authenticate and authorize // requests based on a signature composed of an access key ID and a // corresponding secret access key. // See https://docs.aws.amazon.com/general/latest/gr/aws-security-credentials.html // +optional Credentials *AWSSecurityCredentials `json:"credentials,omitempty"` // (Amazon EKS only) The ARN of an IAM role which can be impersonated // to obtain AWS permissions. // See https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html // +optional EksIAMRole *apis.ARN `json:"iamRole,omitempty"` }
AWSAuth contains multiple authentication methods for AWS services.
+k8s:deepcopy-gen=true
func (*AWSAuth) DeepCopy ¶ added in v1.23.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSAuth.
func (*AWSAuth) DeepCopyInto ¶ added in v1.23.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AWSEndpoint ¶ added in v1.23.0
AWSEndpoint contains parameters which are used to override the destination of REST API calls to AWS services. It allows, for example, to target API-compatible alternatives to the public AWS cloud (Localstack, Minio, ElasticMQ, ...).
+k8s:deepcopy-gen=true
func (*AWSEndpoint) DeepCopy ¶ added in v1.23.0
func (in *AWSEndpoint) DeepCopy() *AWSEndpoint
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSEndpoint.
func (*AWSEndpoint) DeepCopyInto ¶ added in v1.23.0
func (in *AWSEndpoint) DeepCopyInto(out *AWSEndpoint)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AWSSecurityCredentials ¶ added in v1.23.0
type AWSSecurityCredentials struct { AccessKeyID ValueFromField `json:"accessKeyID"` SecretAccessKey ValueFromField `json:"secretAccessKey"` }
AWSSecurityCredentials represents a set of AWS security credentials.
+k8s:deepcopy-gen=true
func (*AWSSecurityCredentials) DeepCopy ¶ added in v1.23.0
func (in *AWSSecurityCredentials) DeepCopy() *AWSSecurityCredentials
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AWSSecurityCredentials.
func (*AWSSecurityCredentials) DeepCopyInto ¶ added in v1.23.0
func (in *AWSSecurityCredentials) DeepCopyInto(out *AWSSecurityCredentials)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type AdapterConfigurable ¶
type AdapterConfigurable interface { // GetAdapterOverrides returns the adapter overrides. GetAdapterOverrides() *AdapterOverrides }
AdapterConfigurable is implemented by types that can override the default configuration of their receive adapter.
type AdapterOverrides ¶
type AdapterOverrides struct { // Public value indicates if the adapter backed by a Kn Service should have // its network visibility scope set to public. Default scope is cluster-local. Public *bool `json:"public,omitempty"` // Resources limits and requirements applied on adapter container. Resources *corev1.ResourceRequirements `json:"resources,omitempty"` // Pod tolerations. Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // Environment variables applied on adapter container. Env []corev1.EnvVar `json:"env,omitempty"` }
AdapterOverrides are applied on top of the default adapter parameters.
+k8s:deepcopy-gen=true
func (*AdapterOverrides) DeepCopy ¶
func (in *AdapterOverrides) DeepCopy() *AdapterOverrides
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AdapterOverrides.
func (*AdapterOverrides) DeepCopyInto ¶
func (in *AdapterOverrides) DeepCopyInto(out *AdapterOverrides)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CloudEventStatus ¶
type CloudEventStatus struct { // AcceptedEventTypes are the CloudEvent types that a component can process. // +optional AcceptedEventTypes []string `json:"acceptedEventTypes,omitempty"` }
CloudEventStatus contains attributes that event receivers can embed to declare the event types they accept.
+k8s:deepcopy-gen=true
func (*CloudEventStatus) DeepCopy ¶
func (in *CloudEventStatus) DeepCopy() *CloudEventStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudEventStatus.
func (*CloudEventStatus) DeepCopyInto ¶
func (in *CloudEventStatus) DeepCopyInto(out *CloudEventStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EventReceiver ¶
type EventReceiver interface { // AcceptedEventTypes returns the event types accepted by the target. AcceptedEventTypes() []string }
EventReceiver is implemented by types that receive and process events.
type EventSender ¶
type EventSender interface { // GetSink returns the component's event sink. GetSink() *duckv1.Destination }
EventSender is implemented by types that send events to a sink.
type EventSource ¶
type EventSource interface { // GetEventTypes returns the event types generated by the component. GetEventTypes() []string // AsEventSource returns a unique reference to the component suitable // for use as a CloudEvent 'source' attribute. AsEventSource() string }
EventSource is implemented by types that emit events, either by sending them to a sink or by replying to incoming event requests.
type MultiTenant ¶
type MultiTenant interface {
IsMultiTenant() bool
}
MultiTenant is implemented by all multi-tenant component types.
type Reconcilable ¶
type Reconcilable interface { metav1.Object runtime.Object // OwnerRefable is used to construct a generic reconciler for each // component type, and convert custom objects to owner references. kmeta.OwnerRefable // KRShaped is used by generated reconcilers to perform pre and // post-reconcile status updates. duckv1.KRShaped // GetStatusManager returns a manager for the component's status. GetStatusManager() *StatusManager }
Reconcilable is implemented by all TriggerMesh components.
func ReconcilableFromContext ¶
func ReconcilableFromContext(ctx context.Context) Reconcilable
ReconcilableFromContext returns the component instance stored in the context.
type ServiceAccountProvider ¶
type ServiceAccountProvider interface { WantsOwnServiceAccount() bool ServiceAccountOptions() []resource.ServiceAccountOption }
ServiceAccountProvider is implemented by types which are able to influence the shape of the ServiceAccount used by their own receive adapter.
type Status ¶
type Status struct { duckv1.SourceStatus `json:",inline"` duckv1.AddressStatus `json:",inline"` // Accepted CloudEvent attributes CloudEventStatus `json:",inline"` }
Status defines the observed state of a component instance.
+k8s:deepcopy-gen=true
func (*Status) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Status.
func (*Status) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type StatusManager ¶
type StatusManager struct { apis.ConditionSet *Status }
StatusManager manages the status of a TriggerMesh component.
func (*StatusManager) MarkNoSink ¶
func (m *StatusManager) MarkNoSink()
MarkNoSink sets the SinkProvided condition to False.
func (*StatusManager) MarkRBACNotBound ¶
func (m *StatusManager) MarkRBACNotBound()
MarkRBACNotBound sets the Deployed condition to False, indicating that the adapter's ServiceAccount couldn't be bound.
func (*StatusManager) MarkSink ¶
func (m *StatusManager) MarkSink(uri *apis.URL)
MarkSink sets the SinkProvided condition to True using the given URI.
func (*StatusManager) PropagateDeploymentAvailability ¶
func (m *StatusManager) PropagateDeploymentAvailability(ctx context.Context, d *appsv1.Deployment, pl corelistersv1.PodNamespaceLister)
PropagateDeploymentAvailability uses the readiness of the provided Deployment to determine whether the Deployed condition should be marked as True or False. Given an optional PodLister interface, the status of dependant Pods is inspected to generate a more meaningful failure reason in case of non-ready status of the Deployment.
func (*StatusManager) PropagateServiceAvailability ¶
func (m *StatusManager) 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.
func (*StatusManager) SetRoute ¶
func (m *StatusManager) SetRoute(urlPath string)
SetRoute appends the given URL path to the current target's URL.
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.
+k8s:deepcopy-gen=true
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.