diff --git a/specs/common/error-signalling.md b/specs/common/error-signalling.md new file mode 100644 index 000000000..59b6f895d --- /dev/null +++ b/specs/common/error-signalling.md @@ -0,0 +1,155 @@ +# Error Signalling + + + +Knative APIs use the +[Kubernetes Conditions convention](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties) +to communicate errors and problems to the user. Note that Knative customizes the +general Kubernetes recommendation with a `severity` field, and does not include +`lastHeartbeatTime` for scalability reasons. Each user-visible resource +described in Resource Overview MUST have a `conditions` field in `status`, which +MUST be a list of `Condition` objects described by the following table. + +Fields in the condition which are not marked as "REQUIRED" MAY be omitted to +indicate the default value (i.e. a Condition which does not include a `status` +field is equivalent to a `status` of `"Unknown"`). As `Conditions` are an output +API, an implementation MAY never set these fields; the OpenAPI document MUST +still describe these fields. The actual API object types in an OpenAPI document +might be named `FooCondition` (for a `Foo` resource, for example) to allow +better code generation and disambiguation between similar fields in the same +`apiGroup`. + +
| Field + | +Type + | +Description + | +Default Value If Unset + | +
type
+ |
+ string
+ |
+ The category of the condition, as a short, CamelCase word or phrase.
+ +This is the primary key of the Conditions list when viewed as a map and MUST be +unique across Conditions for a given resource. + |
+ REQUIRED – No default + | +
status
+ |
+ Enum:
|
+ The last measured status of this condition. + | +"Unknown" + | +
reason
+ |
+ string + | +One-word CamelCase reason for the condition's last transition. + | +"" + | +
message
+ |
+ string + | +Human-readable sentence describing the last transition. + | +"" + | +
severity
+ |
+ Enum:
|
+ If present, represents the severity of the condition. An empty severity represents a severity level of "Error". + | +"" + | +
lastTransitionTime
+ |
+ Timestamp + | +Last update time for this condition. + | +(no timestamp specified) + | +
| Field Name | +Field Type | +Description | +
config |
+ KReference (OPTIONAL) |
+ A reference to an object which describes the configuration options for the Broker (for example, a ConfigMap). | +
delivery |
+ DeliverySpec (OPTIONAL) |
+ A default delivery options for Triggers which do not specify more-specific options. If a Trigger specifies any delivery options, this field MUST be ignored. | +
| Field Name | +Field Type | +Description | +
conditions |
+ See Error Signalling | +Used for signalling errors, see link. | +
observedGeneration |
+ int64 | +The latest metadata.generation that the reconciler has attempted. If observedGeneration is updated, conditions MUST be updated with current status in the same transaction. |
+
address |
+ duckv1.Addressable | +Address used to deliver events to the Broker. | +
deadLetterSinkUri |
+ URL (string) | +If spec.delivery.deadLetterSink is specified, the resolved URL of the dead letter address. |
+
| Field Name | +Field Type | +Description | +
broker |
+ string (REQUIRED, IMMUTABLE) |
+ The Broker to which this Trigger is associated. | +
filter |
+ TriggerFilter (OPTIONAL) |
+ Event filters which are used to select events to be delivered to the Trigger's destination. | +
subscriber |
+ duckv1.Destination (REQUIRED) |
+ The destination for delivery of filtered events. | +
delivery |
+ DeliverySpec (OPTIONAL) |
+ Delivery options for this Trigger. | +
| Field Name | +Field Type | +Description | +
conditions |
+ See Error Signalling | +Used for signalling errors, see link. | +
observedGeneration |
+ int64 | +The latest metadata.generation that the reconciler has attempted. If observedGeneration is updated, conditions MUST be updated with current status in the same transaction. |
+
subscriberUri |
+ URL (string) | +The resolved address of the spec.subscriber. |
+
deadLetterSinkUri |
+ URL (string) | +If spec.delivery.deadLetterSink is specified, the resolved URL of the dead letter address. |
+
| Field Name | +Field Type | +Description | +
channelTemplate |
+ object (OPTIONAL) |
+ Implementation-specific parameters to configure the channel. | +
subscribers |
+ []duckv1.SubscriberSpec (FILLED BY SERVER) | +Aggregated subscription information; this array MUST be managed automatically by the controller. | +
delivery |
+ DeliverySpec (OPTIONAL) |
+ Default delivery options for Subscriptions which do not specify more-specific options. If a Subscription specifies _any_ delivery options, this field MUST be ignored. | +
| Field Name | +Field Type | +Description | +
conditions |
+ See Error Signalling | +Used for signalling errors, see link. | +
observedGeneration |
+ int64 | +The latest metadata.generation that the reconciler has attempted. If observedGeneration is updated, conditions MUST be updated with current status in the same transaction. |
+
address |
+ duckv1.Addressable | +Address used to deliver events to the Broker. | +
subscribers |
+ []duckv1.SubscriberStatus | +Resolved addresses for the spec.subscribers (subscriptions to this Channel). |
+
deadLetterSinkUri |
+ URL (string) | +If spec.delivery.deadLetterSink is specified, the resolved URL of the dead letter address. |
+
| Field Name | +Field Type | +Description | +
channel |
+ KReference (REQUIRED, IMMUTABLE) |
+ The channel this subscription receives events from. namespace may not be set (must refer to a Channel in the same namespace). Immutable. |
+
subscriber |
+ duckv1.Destination (OPTIONAL) |
+ The destination for event delivery. | +
reply |
+ duckv1.Destination (OPTIONAL) |
+ The destination for reply events from spec.subscriber. |
+
delivery |
+ DeliverySpec (OPTIONAL) |
+ Delivery options for this Subscription. | +
| Field Name | +Field Type | +Description | +
conditions |
+ See Error Signalling | +Used for signalling errors, see link. | +
observedGeneration |
+ int64 | +The latest metadata.generation that the reconciler has attempted. If observedGeneration is updated, conditions MUST be updated with current status in the same transaction. |
+
physicalSubscription |
+ PhysicalSubscriptionStatus | +The fully resolved values for spec endpoint references. |
+
| Field Name | +Field Type | +Description | +
address |
+ duckv1.Addressable | +Address used to deliver events to the resource. | +
| Field Name | +Field Type | +Description | +
url |
+ URL (string) | +Address used to deliver events to the Addressable. | +
| Field Name | +Field Type | +Description | +
ref |
+ duckv1.KReference (OPTIONAL) |
+ An ObjectReference to a cluster resource to deliver events to. | +
uri |
+ URL (string) (OPTIONAL) |
+ A URL (possibly relative to ref) to deliver events to. |
+
| Field Name | +Field Type | +Description | +
uid |
+ UID (string) | +UID is used to disambiguate Subscriptions which might be recreated. | +
generation |
+ int64 | +Generation of the copied Subscription. | +
subscriberUri |
+ URL (string) | +The resolved address of the Subscription's spec.subscriber. |
+
replyUri |
+ URL (string) | +The resolved address of the Subscription's spec.reply. |
+
delivery |
+ DeliverySpec | +The resolved Subscription delivery options. The deadLetterSink SHOULD use the uri form. |
+
| Field Name | +Field Type | +Description | +
uid |
+ UID (string) | +UID is used to disambiguate Subscriptions which might be recreated. | +
generation |
+ int64 | +Generation of the copied Subscription. | +
ready |
+ kubernetes v1/ConditionStatus | +Ready status of the Subscription's programming into the Channel data plane. | +
message |
+ string | +A human readable message indicating details of ready status. |
+
| Field Name | +Field Type | +Description | +
deadLetterSink |
+ duckv1.Destination (OPTIONAL) | +Fallback address used to deliver events which cannot be delivered during the flow. An implementation MAY place limits on the allowed destinations for the deadLetterSink. |
+
retry |
+ int (OPTIONAL) | +Retry is the minimum number of retries the sender should attempt when sending an event before moving it to the dead letter sink. | +
backoffDelay |
+ string (OPTIONAL) | +The initial delay when retrying delivery, in ISO 8601 format. | +
backoffPolicy |
+ enum ["linear", "exponential"] (OPTIONAL) |
+ Retry timing scaling policy. Linear policy uses the same backoffDelay for each attempt; Exponential policy uses 2^N multiples of backoffDelay |
+
| Field Name | +Field Type | +Description | +
apiVersion |
+ string (REQUIRED) | +ApiVersion of the target reference. | +
kind |
+ string (REQUIRED) | +Kind of the target reference. | +
name |
+ string (REQUIRED) | +Name of the target resource. | +
namespace |
+ string (OPTIONAL) | +Namespace of the target resource. If unspecified, defaults to the same namespace | +
| Field Name | +Field Type | +Description | +
subscriberUri |
+ URL (string) | +Resolved address of the spec.subscriber. |
+
replyUri |
+ URL (string) | +Resolved address of the spec.reply. |
+
deadLetterSinkUri |
+ URL (string) | +Resolved address of the spec.delivery.deadLetterSink. |
+
| Field Name | +Field Type | +Description | +
attributes |
+ map[string]string (OPTIONAL) | +Event filter using exact match on event context attributes. Each key in the map MUST be compared with the equivalent key in the event context. All keys MUST match (as described below) the event attributes for the event to be selected by the Trigger.
+ + For each key specified in the filter, an attribute with that name MUST be present in the event to match. If the value corresponding to the key is non-empty, the value MUST be an exact (case-sensitive) match to attribute value in the event; an empty string MUST match all attribute values. |
+
This is the primary key of the Conditions list when viewed as a map. | REQUIRED – No default | -| `status` | Enum:
@@ -148,45 +147,46 @@ deployment scenarios (by frequency).
## Extensions
-Extending the Knative resource model allows for custom semantics to be
-offered by implementions of the specification. Unless otherwise noted,
-implementations of this specification MAY define extensions but those
-extensions MUST NOT contradict the semantics defined within this specification.
+Extending the Knative resource model allows for custom semantics to be offered
+by implementions of the specification. Unless otherwise noted, implementations
+of this specification MAY define extensions but those extensions MUST NOT
+contradict the semantics defined within this specification.
There are several ways in which implementations can extend the model:
-* Annotations and Labels
|