From 9ca88b988031b1b0ba4cf8d1d79bec787427a5b5 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Mon, 9 Sep 2019 09:33:35 -0400 Subject: [PATCH 01/10] Add ErrorChannel to Channelable --- pkg/apis/duck/v1alpha1/channelable_types.go | 16 ++++++++++++++++ pkg/apis/duck/v1alpha1/channelable_types_test.go | 11 +++++++++++ pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go | 6 ++++++ 3 files changed, 33 insertions(+) diff --git a/pkg/apis/duck/v1alpha1/channelable_types.go b/pkg/apis/duck/v1alpha1/channelable_types.go index 57fc0093056..c01f04acc67 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types.go +++ b/pkg/apis/duck/v1alpha1/channelable_types.go @@ -25,6 +25,7 @@ import ( duckv1 "knative.dev/pkg/apis/duck/v1" "knative.dev/pkg/apis/duck/v1alpha1" duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1" + apisv1alpha1 "knative.dev/pkg/apis/v1alpha1" ) // +genclient @@ -46,6 +47,12 @@ type Channelable struct { // ChannelableSpec contains Spec of the Channelable object type ChannelableSpec struct { SubscribableTypeSpec `json:",inline"` + + // ErrorChannel is the channel receiving messages that couldn't be sent to + // subscribers. One message is sent to this channel per failing subscriber. + // + // +optional + ErrorChannel *apisv1alpha1.Destination `json:"errorChannel,omitempty"` } // ChannelableStatus contains the Status of a Channelable object. @@ -82,6 +89,15 @@ func (c *Channelable) Populate() { ReplyURI: "sink2", }}, } + c.Spec.ErrorChannel = &apisv1alpha1.Destination{ + ObjectReference: &corev1.ObjectReference{ + Name: "aname", + }, + URI: &apis.URL{ + Scheme: "http", + Host: "test-error-domain", + }, + } c.Status = ChannelableStatus{ AddressStatus: v1alpha1.AddressStatus{ Address: &v1alpha1.Addressable{ diff --git a/pkg/apis/duck/v1alpha1/channelable_types_test.go b/pkg/apis/duck/v1alpha1/channelable_types_test.go index 06a0b3af7c5..07a8f305bb6 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types_test.go +++ b/pkg/apis/duck/v1alpha1/channelable_types_test.go @@ -23,6 +23,7 @@ import ( "knative.dev/pkg/apis" "knative.dev/pkg/apis/duck/v1alpha1" duckv1beta1 "knative.dev/pkg/apis/duck/v1beta1" + apisv1alpha1 "knative.dev/pkg/apis/v1alpha1" "github.com/google/go-cmp/cmp" ) @@ -57,7 +58,17 @@ func TestChannelablePopulate(t *testing.T) { }}, }, }, + ErrorChannel: &apisv1alpha1.Destination{ + ObjectReference: &corev1.ObjectReference{ + Name: "aname", + }, + URI: &apis.URL{ + Scheme: "http", + Host: "test-error-domain", + }, + }, }, + Status: ChannelableStatus{ AddressStatus: v1alpha1.AddressStatus{ Address: &v1alpha1.Addressable{ diff --git a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go index e6976a3f758..7f9ae551275 100644 --- a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go @@ -23,6 +23,7 @@ package v1alpha1 import ( v1 "k8s.io/api/core/v1" runtime "k8s.io/apimachinery/pkg/runtime" + apisv1alpha1 "knative.dev/pkg/apis/v1alpha1" ) // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. @@ -151,6 +152,11 @@ func (in *ChannelableList) DeepCopyObject() runtime.Object { func (in *ChannelableSpec) DeepCopyInto(out *ChannelableSpec) { *out = *in in.SubscribableTypeSpec.DeepCopyInto(&out.SubscribableTypeSpec) + if in.ErrorChannel != nil { + in, out := &in.ErrorChannel, &out.ErrorChannel + *out = new(apisv1alpha1.Destination) + (*in).DeepCopyInto(*out) + } return } From 5220149a5b7bdbddad52d4b70fb9cca5e389b610 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Mon, 23 Sep 2019 13:28:08 -0400 Subject: [PATCH 02/10] sync with latest design --- .../duck/v1alpha1/channel_template_types.go | 6 +- pkg/apis/duck/v1alpha1/channelable_types.go | 71 ++++++++++++++++--- .../duck/v1alpha1/channelable_types_test.go | 22 ++++-- .../duck/v1alpha1/zz_generated.deepcopy.go | 47 +++++++++++- 4 files changed, 124 insertions(+), 22 deletions(-) diff --git a/pkg/apis/duck/v1alpha1/channel_template_types.go b/pkg/apis/duck/v1alpha1/channel_template_types.go index 819127d7048..cb80d7d3d59 100644 --- a/pkg/apis/duck/v1alpha1/channel_template_types.go +++ b/pkg/apis/duck/v1alpha1/channel_template_types.go @@ -16,8 +16,10 @@ limitations under the License. package v1alpha1 -import "k8s.io/apimachinery/pkg/runtime" -import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" +import ( + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/runtime" +) // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type ChannelTemplateSpec struct { diff --git a/pkg/apis/duck/v1alpha1/channelable_types.go b/pkg/apis/duck/v1alpha1/channelable_types.go index c01f04acc67..712d09095a2 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types.go +++ b/pkg/apis/duck/v1alpha1/channelable_types.go @@ -48,13 +48,53 @@ type Channelable struct { type ChannelableSpec struct { SubscribableTypeSpec `json:",inline"` - // ErrorChannel is the channel receiving messages that couldn't be sent to - // subscribers. One message is sent to this channel per failing subscriber. + // +optional + Delivery *DeliverySpec `json:"delivery,omitempty"` +} + +// DeliverySpec contains the channel delivery options +// +type DeliverySpec struct { + // ErrorSink is the sink receiving messages that couldn't be sent to + // subscribers. One message is sent per failing subscriber. // + // Depending on the capabilities of the channel implementation, either: + // * ErrorSink is a subscription to the channel's errorChannel (see ChannelableStatus), or + // * the channel attempts to deliver the error to ErrorSink directly. + // + // Either way, the channel implementation should honor the supported delivery options (retry, etc...) + // +optional + ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` + + // Retry is the mimimum number of retries the channel should attempt when + // sending a message before moving it to the error sink. + // +optional + Retry *int32 `json:"retry,omitempty"` + + // BackoffPolicy is the retry backoff policy (linear, exponential) // +optional - ErrorChannel *apisv1alpha1.Destination `json:"errorChannel,omitempty"` + BackoffPolicy *BackoffPolicyType `json:"backoffPolicy,omitempty"` + + // BackoffDelay is the delay before retrying. + // More information on Duration format: https://www.ietf.org/rfc/rfc3339.txt + // + // For linear policy, backoff delay is the time interval between retries. + // For exponential policy , backoff delay is backoffDelay*10^ + // +optional + BackoffDelay *string } +// BackoffPolicyType is the type for backoff policies +type BackoffPolicyType string + +const ( + // Linear backoff policy + BackoffPolicyLinear BackoffPolicyType = "linear" + + // Exponential backoff policy + BackoffPolicyExponential BackoffPolicyType = "exponential" +) + // ChannelableStatus contains the Status of a Channelable object. type ChannelableStatus struct { // inherits duck/v1 Status, which currently provides: @@ -65,6 +105,9 @@ type ChannelableStatus struct { v1alpha1.AddressStatus `json:",inline"` // Subscribers is populated with the statuses of each of the Channelable's subscribers. SubscribableTypeStatus `json:",inline"` + // ErrorChannel is the reference to the channel where failed events are sent to. + // +optional + ErrorChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` } var ( @@ -89,14 +132,22 @@ func (c *Channelable) Populate() { ReplyURI: "sink2", }}, } - c.Spec.ErrorChannel = &apisv1alpha1.Destination{ - ObjectReference: &corev1.ObjectReference{ - Name: "aname", - }, - URI: &apis.URL{ - Scheme: "http", - Host: "test-error-domain", + retry := int32(5) + linear := BackoffPolicyLinear + delay := "5s" + c.Spec.Delivery = &DeliverySpec{ + ErrorSink: &apisv1alpha1.Destination{ + ObjectReference: &corev1.ObjectReference{ + Name: "aname", + }, + URI: &apis.URL{ + Scheme: "http", + Host: "test-error-domain", + }, }, + Retry: &retry, + BackoffPolicy: &linear, + BackoffDelay: &delay, } c.Status = ChannelableStatus{ AddressStatus: v1alpha1.AddressStatus{ diff --git a/pkg/apis/duck/v1alpha1/channelable_types_test.go b/pkg/apis/duck/v1alpha1/channelable_types_test.go index 07a8f305bb6..c07472539f3 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types_test.go +++ b/pkg/apis/duck/v1alpha1/channelable_types_test.go @@ -41,6 +41,9 @@ func TestChannelableGetListType(t *testing.T) { func TestChannelablePopulate(t *testing.T) { got := &Channelable{} + retry := int32(5) + linear := BackoffPolicyLinear + delay := "5s" want := &Channelable{ Spec: ChannelableSpec{ SubscribableTypeSpec: SubscribableTypeSpec{ @@ -58,14 +61,19 @@ func TestChannelablePopulate(t *testing.T) { }}, }, }, - ErrorChannel: &apisv1alpha1.Destination{ - ObjectReference: &corev1.ObjectReference{ - Name: "aname", - }, - URI: &apis.URL{ - Scheme: "http", - Host: "test-error-domain", + Delivery: &DeliverySpec{ + ErrorSink: &apisv1alpha1.Destination{ + ObjectReference: &corev1.ObjectReference{ + Name: "aname", + }, + URI: &apis.URL{ + Scheme: "http", + Host: "test-error-domain", + }, }, + Retry: &retry, + BackoffPolicy: &linear, + BackoffDelay: &delay, }, }, diff --git a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go index 7f9ae551275..a8aacad4a17 100644 --- a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go @@ -152,9 +152,9 @@ func (in *ChannelableList) DeepCopyObject() runtime.Object { func (in *ChannelableSpec) DeepCopyInto(out *ChannelableSpec) { *out = *in in.SubscribableTypeSpec.DeepCopyInto(&out.SubscribableTypeSpec) - if in.ErrorChannel != nil { - in, out := &in.ErrorChannel, &out.ErrorChannel - *out = new(apisv1alpha1.Destination) + if in.Delivery != nil { + in, out := &in.Delivery, &out.Delivery + *out = new(DeliverySpec) (*in).DeepCopyInto(*out) } return @@ -176,6 +176,11 @@ func (in *ChannelableStatus) DeepCopyInto(out *ChannelableStatus) { in.Status.DeepCopyInto(&out.Status) in.AddressStatus.DeepCopyInto(&out.AddressStatus) in.SubscribableTypeStatus.DeepCopyInto(&out.SubscribableTypeStatus) + if in.ErrorChannel != nil { + in, out := &in.ErrorChannel, &out.ErrorChannel + *out = new(v1.ObjectReference) + **out = **in + } return } @@ -189,6 +194,42 @@ func (in *ChannelableStatus) DeepCopy() *ChannelableStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeliverySpec) DeepCopyInto(out *DeliverySpec) { + *out = *in + if in.ErrorSink != nil { + in, out := &in.ErrorSink, &out.ErrorSink + *out = new(apisv1alpha1.Destination) + (*in).DeepCopyInto(*out) + } + if in.Retry != nil { + in, out := &in.Retry, &out.Retry + *out = new(int32) + **out = **in + } + if in.BackoffPolicy != nil { + in, out := &in.BackoffPolicy, &out.BackoffPolicy + *out = new(BackoffPolicyType) + **out = **in + } + if in.BackoffDelay != nil { + in, out := &in.BackoffDelay, &out.BackoffDelay + *out = new(string) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeliverySpec. +func (in *DeliverySpec) DeepCopy() *DeliverySpec { + if in == nil { + return nil + } + out := new(DeliverySpec) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Resource) DeepCopyInto(out *Resource) { *out = *in From 67b1e32a93148ee35dedb27e566c29f1ffd55584 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Wed, 25 Sep 2019 09:13:50 -0400 Subject: [PATCH 03/10] move delivery spec to own file --- pkg/apis/duck/v1alpha1/channelable_types.go | 46 +------------- pkg/apis/duck/v1alpha1/delivery_types.go | 66 +++++++++++++++++++++ 2 files changed, 68 insertions(+), 44 deletions(-) create mode 100644 pkg/apis/duck/v1alpha1/delivery_types.go diff --git a/pkg/apis/duck/v1alpha1/channelable_types.go b/pkg/apis/duck/v1alpha1/channelable_types.go index 712d09095a2..5f51311a63e 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types.go +++ b/pkg/apis/duck/v1alpha1/channelable_types.go @@ -48,53 +48,11 @@ type Channelable struct { type ChannelableSpec struct { SubscribableTypeSpec `json:",inline"` + // DeliverySpec contains options controlling the event delivery // +optional Delivery *DeliverySpec `json:"delivery,omitempty"` } -// DeliverySpec contains the channel delivery options -// -type DeliverySpec struct { - // ErrorSink is the sink receiving messages that couldn't be sent to - // subscribers. One message is sent per failing subscriber. - // - // Depending on the capabilities of the channel implementation, either: - // * ErrorSink is a subscription to the channel's errorChannel (see ChannelableStatus), or - // * the channel attempts to deliver the error to ErrorSink directly. - // - // Either way, the channel implementation should honor the supported delivery options (retry, etc...) - // +optional - ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` - - // Retry is the mimimum number of retries the channel should attempt when - // sending a message before moving it to the error sink. - // +optional - Retry *int32 `json:"retry,omitempty"` - - // BackoffPolicy is the retry backoff policy (linear, exponential) - // +optional - BackoffPolicy *BackoffPolicyType `json:"backoffPolicy,omitempty"` - - // BackoffDelay is the delay before retrying. - // More information on Duration format: https://www.ietf.org/rfc/rfc3339.txt - // - // For linear policy, backoff delay is the time interval between retries. - // For exponential policy , backoff delay is backoffDelay*10^ - // +optional - BackoffDelay *string -} - -// BackoffPolicyType is the type for backoff policies -type BackoffPolicyType string - -const ( - // Linear backoff policy - BackoffPolicyLinear BackoffPolicyType = "linear" - - // Exponential backoff policy - BackoffPolicyExponential BackoffPolicyType = "exponential" -) - // ChannelableStatus contains the Status of a Channelable object. type ChannelableStatus struct { // inherits duck/v1 Status, which currently provides: @@ -105,7 +63,7 @@ type ChannelableStatus struct { v1alpha1.AddressStatus `json:",inline"` // Subscribers is populated with the statuses of each of the Channelable's subscribers. SubscribableTypeStatus `json:",inline"` - // ErrorChannel is the reference to the channel where failed events are sent to. + // ErrorChannel is set by the channel when it supports native error handling via a channel // +optional ErrorChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` } diff --git a/pkg/apis/duck/v1alpha1/delivery_types.go b/pkg/apis/duck/v1alpha1/delivery_types.go new file mode 100644 index 00000000000..9344a3dbe65 --- /dev/null +++ b/pkg/apis/duck/v1alpha1/delivery_types.go @@ -0,0 +1,66 @@ +/* +Copyright 2019 The Knative Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package v1alpha1 + +import ( + corev1 "k8s.io/api/core/v1" + apisv1alpha1 "knative.dev/pkg/apis/v1alpha1" +) + +// DeliverySpec contains the delivery options for event senders, +// such as channelable and source. +type DeliverySpec struct { + // ErrorSink is the sink receiving messages that couldn't be sent to + // a destination. + // +optional + ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` + + // Retry is the mimimum number of retries the sender should attempt when + // sending a message before moving it to the error sink. + // +optional + Retry *int32 `json:"retry,omitempty"` + + // BackoffPolicy is the retry backoff policy (linear, exponential) + // +optional + BackoffPolicy *BackoffPolicyType `json:"backoffPolicy,omitempty"` + + // BackoffDelay is the delay before retrying. + // More information on Duration format: https://www.ietf.org/rfc/rfc3339.txt + // + // For linear policy, backoff delay is the time interval between retries. + // For exponential policy , backoff delay is backoffDelay*10^ + // +optional + BackoffDelay *string +} + +// BackoffPolicyType is the type for backoff policies +type BackoffPolicyType string + +const ( + // Linear backoff policy + BackoffPolicyLinear BackoffPolicyType = "linear" + + // Exponential backoff policy + BackoffPolicyExponential BackoffPolicyType = "exponential" +) + +// DeliverStatus contains the Status of an object supporting delivery options. +type DeliverStatus struct { + // ErrorChannel is the reference to the channel where failed events are sent to. + // +optional + ErrorChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` +} From bb456587184a2b5b7ac5c6b0b9316d5b12efd620 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Wed, 25 Sep 2019 10:05:03 -0400 Subject: [PATCH 04/10] add delivery design as markdown --- docs/delivery/README.md | 121 ++++++++++++++++++ docs/delivery/imc.yaml | 19 +++ .../duck/v1alpha1/zz_generated.deepcopy.go | 21 +++ 3 files changed, 161 insertions(+) create mode 100644 docs/delivery/README.md create mode 100644 docs/delivery/imc.yaml diff --git a/docs/delivery/README.md b/docs/delivery/README.md new file mode 100644 index 00000000000..4135f67e41e --- /dev/null +++ b/docs/delivery/README.md @@ -0,0 +1,121 @@ +# Delivery Design + +This document synthetizes the [error handling design document](https://docs.google.com/document/d/1qRrzGoHJQO-oc5p-yRK8IRfugd-FM_PXyM7lN5kcqks). + +## Problem + +Sending events can fail for a variety of reasons (downstream system is down, application logic rejects the invalid message, a runtime exception occurs, etc...) but right now there is no way to control or define the expected behavior in these situations. + +## Requirements + +* Be able to handle events that failed to be delivered + * to channel subscribers. + * to source sink. + * to broker/triggers. +* Be able to identify a message couldn’t be delivered (Observability) +* Be able to leverage existing native error handling mechanisms (eg. dead letter queues). +* Be able to redirect of error'ed events from a channel. + +### Out of Scope + +* Security: No security model has been defined yet at the Knative eventing level. Native brokers might define their own security model and Knative eventing should not prevent using it. + +## Proposal + +### Error Sink + +Channels are responsible for forwarding received messages to subscribers. When they fail to do so, they are responsible for sending the failing messages to an **error sink**. It could be a channel but it does not have to. + +Similarly Event Sources are responsible sending events to a sink and when they fail to do so, they are responsible for sending the failing events to an **error sink**. + +### Dead-Letter Channel + +Channel implementations might leverage the existing native error handling support they provide, usually a dead letter channel, to forward failed messages to the error sink. In that case, the error sink might be realized by creating a subscription on the error channel. + +### Retry + +Typically channel implementations and event sources retry sending messages before redirecting them to the error sink. +While there are many different ways to implement the retry logic +(immediate retry, retry queue, etc...), implementations usually +rely on a common set of configuration parameters, such as +the number of retries and the interval between retries. + +### Delivery Specification + +The goal of this delivery specification is to formally define the vocabulary related to capabilities defined above (error sink, dead-letter queues and retry) to provide consistency accross all Knative event sources, channels and brokers. + +The minimal delivery specification looks like this: + +```go + +// DeliverySpec contains the delivery options for event senders, +// such as channelable and source. +type DeliverySpec struct { + // ErrorSink is the sink receiving messages that couldn't be sent to + // a destination. + // +optional + ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` + + // Retry is the mimimum number of retries the sender should attempt when + // sending a message before moving it to the error sink. + // +optional + Retry *int32 `json:"retry,omitempty"` + + // BackoffPolicy is the retry backoff policy (linear, exponential) + // +optional + BackoffPolicy *BackoffPolicyType `json:"backoffPolicy,omitempty"` + + // BackoffDelay is the delay before retrying. + // More information on Duration format: https://www.ietf.org/rfc/rfc3339.txt + // + // For linear policy, backoff delay is the time interval between retries. + // For exponential policy , backoff delay is backoffDelay*10^ + // +optional + BackoffDelay *string +} + +// BackoffPolicyType is the type for backoff policies +type BackoffPolicyType string + +const ( + // Linear backoff policy + BackoffPolicyLinear BackoffPolicyType = "linear" + + // Exponential backoff policy + BackoffPolicyExponential BackoffPolicyType = "exponential" +) +``` + +Channel, brokers and event sources are not required to support all this capabilities and are free to add more delivery options. + +### Exposing underlying DLC + +Channels supporting dead letter queue should advertise it in their status. + +```go + +// DeliverStatus contains the Status of an object supporting delivery options. +type DeliverStatus struct { + // ErrorChannel is the reference to the channel where failed events are sent to. + // +optional + ErrorChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` +} +``` + +### Error messages + +The error message is the original messages annotated with various CloudEvents attributes, eg. to be able to tell why the message couldn’t be delivered. + +Note that multiple copies of the same message can be sent to the error sink due to multiple subscription failures. + +Brokers might decide to change the event type before reposting the failed event into the broker. This could be done by having a special error sink specific to broker. + +### CloudEvent extensions + +(might move to the CloudEvent spec repository) + +Here a possible set of CloudEvent extensions: + +* errorsubscriberuri: The URI of the subscriber +* errorreason: The reason for dead lettering the event +* errorretry: How many times the channel tried to send the message \ No newline at end of file diff --git a/docs/delivery/imc.yaml b/docs/delivery/imc.yaml new file mode 100644 index 00000000000..458142c9df9 --- /dev/null +++ b/docs/delivery/imc.yaml @@ -0,0 +1,19 @@ +apiVersion: messaging.knative.dev/v1alpha1 +kind: InMemoryChannel +metadata: + name: imc +spec: + delivery: + errorSink: + apiVersion: messaging.knative.dev/v1alpha1 + kind: Channel + name: subscriber + retry: 5 + backoffPolicy: exponential + backoffDelay: 3s + subscribable: + subscribers: + - ref: + apiVersion: messaging.knative.dev/v1alpha1 + kind: Subscription + name: subscriber diff --git a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go index a8aacad4a17..502ddd8fe1e 100644 --- a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go @@ -194,6 +194,27 @@ func (in *ChannelableStatus) DeepCopy() *ChannelableStatus { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeliverStatus) DeepCopyInto(out *DeliverStatus) { + *out = *in + if in.ErrorChannel != nil { + in, out := &in.ErrorChannel, &out.ErrorChannel + *out = new(v1.ObjectReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeliverStatus. +func (in *DeliverStatus) DeepCopy() *DeliverStatus { + if in == nil { + return nil + } + out := new(DeliverStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeliverySpec) DeepCopyInto(out *DeliverySpec) { *out = *in From 3d1da46e67f50b27c69a315cdca689ab593db113 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Wed, 25 Sep 2019 13:58:57 -0400 Subject: [PATCH 05/10] fix typos --- docs/delivery/README.md | 8 ++++---- pkg/apis/duck/v1alpha1/delivery_types.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/delivery/README.md b/docs/delivery/README.md index 4135f67e41e..f4cc5ad4250 100644 --- a/docs/delivery/README.md +++ b/docs/delivery/README.md @@ -20,7 +20,7 @@ Sending events can fail for a variety of reasons (downstream system is down, app * Security: No security model has been defined yet at the Knative eventing level. Native brokers might define their own security model and Knative eventing should not prevent using it. -## Proposal +## Day 1 Proposal ### Error Sink @@ -42,7 +42,7 @@ the number of retries and the interval between retries. ### Delivery Specification -The goal of this delivery specification is to formally define the vocabulary related to capabilities defined above (error sink, dead-letter queues and retry) to provide consistency accross all Knative event sources, channels and brokers. +The goal of this delivery specification is to formally define the vocabulary related to capabilities defined above (error sink, dead-letter queues and retry) to provide consistency across all Knative event sources, channels and brokers. The minimal delivery specification looks like this: @@ -56,7 +56,7 @@ type DeliverySpec struct { // +optional ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` - // Retry is the mimimum number of retries the sender should attempt when + // Retry is the minimum number of retries the sender should attempt when // sending a message before moving it to the error sink. // +optional Retry *int32 `json:"retry,omitempty"` @@ -118,4 +118,4 @@ Here a possible set of CloudEvent extensions: * errorsubscriberuri: The URI of the subscriber * errorreason: The reason for dead lettering the event -* errorretry: How many times the channel tried to send the message \ No newline at end of file +* errorretry: How many times the channel tried to send the message diff --git a/pkg/apis/duck/v1alpha1/delivery_types.go b/pkg/apis/duck/v1alpha1/delivery_types.go index 9344a3dbe65..13dce26b27a 100644 --- a/pkg/apis/duck/v1alpha1/delivery_types.go +++ b/pkg/apis/duck/v1alpha1/delivery_types.go @@ -29,7 +29,7 @@ type DeliverySpec struct { // +optional ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` - // Retry is the mimimum number of retries the sender should attempt when + // Retry is the minimum number of retries the sender should attempt when // sending a message before moving it to the error sink. // +optional Retry *int32 `json:"retry,omitempty"` From d325d5c2a1114dc54fad0c624f22b2eda687edc2 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Thu, 26 Sep 2019 11:30:32 -0400 Subject: [PATCH 06/10] use event everywhere. use deadLetterSink and deadLetterChannel --- docs/delivery/README.md | 41 +++++++++++++++++++++-------------------- docs/delivery/imc.yaml | 8 ++++---- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/docs/delivery/README.md b/docs/delivery/README.md index f4cc5ad4250..d7ab6cacb57 100644 --- a/docs/delivery/README.md +++ b/docs/delivery/README.md @@ -12,8 +12,9 @@ Sending events can fail for a variety of reasons (downstream system is down, app * to channel subscribers. * to source sink. * to broker/triggers. -* Be able to identify a message couldn’t be delivered (Observability) -* Be able to leverage existing native error handling mechanisms (eg. dead letter queues). +* Be able to identify events that could not be delivered (Observability) +* Be able to leverage existing error handling mechanisms provided by the +underlying platform (eg. RabbitMQ dead letter exchange, Amazon SQS dead letter queue, Azure Service Bus dead letter queue, etc...). * Be able to redirect of error'ed events from a channel. ### Out of Scope @@ -22,27 +23,27 @@ Sending events can fail for a variety of reasons (downstream system is down, app ## Day 1 Proposal -### Error Sink +### Dead Letter Sink -Channels are responsible for forwarding received messages to subscribers. When they fail to do so, they are responsible for sending the failing messages to an **error sink**. It could be a channel but it does not have to. +Channels are responsible for forwarding received messages to subscribers. When they fail to do so, they are responsible for sending the failing events to an **dead letter sink**. It could be a channel but it does not have to. -Similarly Event Sources are responsible sending events to a sink and when they fail to do so, they are responsible for sending the failing events to an **error sink**. +Similarly Event Sources are responsible for sending events to a sink and when they fail to do so, they are responsible for sending the failing events to an **dead letter sink**. ### Dead-Letter Channel -Channel implementations might leverage the existing native error handling support they provide, usually a dead letter channel, to forward failed messages to the error sink. In that case, the error sink might be realized by creating a subscription on the error channel. +Knative Channel implementations may leverage existing platform native error handling support they might provide, like a a [_Dead Letter Channel_](https://www.enterpriseintegrationpatterns.com/patterns/messaging/DeadLetterChannel.html), to forward failed events from their _Dead Letter Channel_ to the configured error sink. ### Retry -Typically channel implementations and event sources retry sending messages before redirecting them to the error sink. +Channel implementations, event sources and brokers should retry sending events before redirecting them to the dead letter sink. While there are many different ways to implement the retry logic -(immediate retry, retry queue, etc...), implementations usually +(immediate retry, retry queue, etc...), implementations should rely on a common set of configuration parameters, such as the number of retries and the interval between retries. ### Delivery Specification -The goal of this delivery specification is to formally define the vocabulary related to capabilities defined above (error sink, dead-letter queues and retry) to provide consistency across all Knative event sources, channels and brokers. +The goal of this delivery specification is to formally define the vocabulary related to capabilities defined above (dead letter sink, dead-letter queues and retry) to provide consistency across all Knative event sources, channel implementations and brokers. The minimal delivery specification looks like this: @@ -51,13 +52,13 @@ The minimal delivery specification looks like this: // DeliverySpec contains the delivery options for event senders, // such as channelable and source. type DeliverySpec struct { - // ErrorSink is the sink receiving messages that couldn't be sent to + // DeadLetterSink is the sink receiving events that couldn't be sent to // a destination. // +optional - ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` + DeadLetterSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` // Retry is the minimum number of retries the sender should attempt when - // sending a message before moving it to the error sink. + // sending av event before moving it to the dead letter sink // +optional Retry *int32 `json:"retry,omitempty"` @@ -90,21 +91,21 @@ Channel, brokers and event sources are not required to support all this capabil ### Exposing underlying DLC -Channels supporting dead letter queue should advertise it in their status. +Channel implementation supporting dead letter channel should advertise it in their status. ```go // DeliverStatus contains the Status of an object supporting delivery options. type DeliverStatus struct { - // ErrorChannel is the reference to the channel where failed events are sent to. + // DeadLetterChannel is the reference to the native, platform specific channel where failed events are sent to. // +optional - ErrorChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` + DeadLetterChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` } ``` -### Error messages +### Error events -The error message is the original messages annotated with various CloudEvents attributes, eg. to be able to tell why the message couldn’t be delivered. +The error event is the original events annotated with various CloudEvents attributes, eg. to be able to tell why the message couldn’t be delivered. Note that multiple copies of the same message can be sent to the error sink due to multiple subscription failures. @@ -116,6 +117,6 @@ Brokers might decide to change the event type before reposting the failed event Here a possible set of CloudEvent extensions: -* errorsubscriberuri: The URI of the subscriber -* errorreason: The reason for dead lettering the event -* errorretry: How many times the channel tried to send the message +* deadlettersubscriberuri: The URI of the subscriber +* deadletterreason: The reason for dead lettering the event +* deadletterretry: How many times the channel tried to send the event diff --git a/docs/delivery/imc.yaml b/docs/delivery/imc.yaml index 458142c9df9..60203320292 100644 --- a/docs/delivery/imc.yaml +++ b/docs/delivery/imc.yaml @@ -4,10 +4,10 @@ metadata: name: imc spec: delivery: - errorSink: - apiVersion: messaging.knative.dev/v1alpha1 - kind: Channel - name: subscriber + deadLetterSink: + apiVersion: serving.knative.dev/v1beta1 + kind: Service + name: handle-error retry: 5 backoffPolicy: exponential backoffDelay: 3s From 796938dd10a98eba31f9987b0fda598538551bdf Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Thu, 26 Sep 2019 11:38:27 -0400 Subject: [PATCH 07/10] update deliveryspec --- docs/delivery/README.md | 12 ++++++------ pkg/apis/duck/v1alpha1/channelable_types.go | 2 +- pkg/apis/duck/v1alpha1/channelable_types_test.go | 2 +- pkg/apis/duck/v1alpha1/delivery_types.go | 11 ++++++----- pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go | 8 ++++---- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/docs/delivery/README.md b/docs/delivery/README.md index d7ab6cacb57..9a2f46fd53e 100644 --- a/docs/delivery/README.md +++ b/docs/delivery/README.md @@ -4,7 +4,7 @@ This document synthetizes the [error handling design document](https://docs.goog ## Problem -Sending events can fail for a variety of reasons (downstream system is down, application logic rejects the invalid message, a runtime exception occurs, etc...) but right now there is no way to control or define the expected behavior in these situations. +Sending events can fail for a variety of reasons (downstream system is down, application logic rejects the invalid event, a runtime exception occurs, etc...) but right now there is no way to control or define the expected behavior in these situations. ## Requirements @@ -25,7 +25,7 @@ underlying platform (eg. RabbitMQ dead letter exchange, Amazon SQS dead letter q ### Dead Letter Sink -Channels are responsible for forwarding received messages to subscribers. When they fail to do so, they are responsible for sending the failing events to an **dead letter sink**. It could be a channel but it does not have to. +Channels are responsible for forwarding received events to subscribers. When they fail to do so, they are responsible for sending the failing events to an **dead letter sink**. It could be a channel but it does not have to. Similarly Event Sources are responsible for sending events to a sink and when they fail to do so, they are responsible for sending the failing events to an **dead letter sink**. @@ -55,7 +55,7 @@ type DeliverySpec struct { // DeadLetterSink is the sink receiving events that couldn't be sent to // a destination. // +optional - DeadLetterSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` + DeadLetterSink *apisv1alpha1.Destination `json:"deadLetterSink,omitempty"` // Retry is the minimum number of retries the sender should attempt when // sending av event before moving it to the dead letter sink @@ -99,15 +99,15 @@ Channel implementation supporting dead letter channel should advertise it in the type DeliverStatus struct { // DeadLetterChannel is the reference to the native, platform specific channel where failed events are sent to. // +optional - DeadLetterChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` + DeadLetterChannel *corev1.ObjectReference `json:"deadLetterChannel,omitempty"` } ``` ### Error events -The error event is the original events annotated with various CloudEvents attributes, eg. to be able to tell why the message couldn’t be delivered. +The error event is the original events annotated with various CloudEvents attributes, eg. to be able to tell why the event could not be delivered. -Note that multiple copies of the same message can be sent to the error sink due to multiple subscription failures. +Note that multiple copies of the same event can be sent to the error sink due to multiple subscription failures. Brokers might decide to change the event type before reposting the failed event into the broker. This could be done by having a special error sink specific to broker. diff --git a/pkg/apis/duck/v1alpha1/channelable_types.go b/pkg/apis/duck/v1alpha1/channelable_types.go index 5f51311a63e..957ff762a41 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types.go +++ b/pkg/apis/duck/v1alpha1/channelable_types.go @@ -94,7 +94,7 @@ func (c *Channelable) Populate() { linear := BackoffPolicyLinear delay := "5s" c.Spec.Delivery = &DeliverySpec{ - ErrorSink: &apisv1alpha1.Destination{ + DeadLetterSink: &apisv1alpha1.Destination{ ObjectReference: &corev1.ObjectReference{ Name: "aname", }, diff --git a/pkg/apis/duck/v1alpha1/channelable_types_test.go b/pkg/apis/duck/v1alpha1/channelable_types_test.go index c07472539f3..0374a202739 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types_test.go +++ b/pkg/apis/duck/v1alpha1/channelable_types_test.go @@ -62,7 +62,7 @@ func TestChannelablePopulate(t *testing.T) { }, }, Delivery: &DeliverySpec{ - ErrorSink: &apisv1alpha1.Destination{ + DeadLetterSink: &apisv1alpha1.Destination{ ObjectReference: &corev1.ObjectReference{ Name: "aname", }, diff --git a/pkg/apis/duck/v1alpha1/delivery_types.go b/pkg/apis/duck/v1alpha1/delivery_types.go index 13dce26b27a..81ab277c24c 100644 --- a/pkg/apis/duck/v1alpha1/delivery_types.go +++ b/pkg/apis/duck/v1alpha1/delivery_types.go @@ -24,13 +24,13 @@ import ( // DeliverySpec contains the delivery options for event senders, // such as channelable and source. type DeliverySpec struct { - // ErrorSink is the sink receiving messages that couldn't be sent to + // DeadLetterSink is the sink receiving event that couldn't be sent to // a destination. // +optional - ErrorSink *apisv1alpha1.Destination `json:"errorSink,omitempty"` + DeadLetterSink *apisv1alpha1.Destination `json:"deadLetterSink,omitempty"` // Retry is the minimum number of retries the sender should attempt when - // sending a message before moving it to the error sink. + // sending an event before moving it to the dead letter sink. // +optional Retry *int32 `json:"retry,omitempty"` @@ -60,7 +60,8 @@ const ( // DeliverStatus contains the Status of an object supporting delivery options. type DeliverStatus struct { - // ErrorChannel is the reference to the channel where failed events are sent to. + // DeadLetterChannel is the reference to the native, platform specific channel + // where failed events are sent to. // +optional - ErrorChannel *corev1.ObjectReference `json:"errorChannel,omitempty"` + DeadLetterChannel *corev1.ObjectReference `json:"deadLetterChannel,omitempty"` } diff --git a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go index 502ddd8fe1e..68ac28ffa44 100644 --- a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go @@ -197,8 +197,8 @@ func (in *ChannelableStatus) DeepCopy() *ChannelableStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeliverStatus) DeepCopyInto(out *DeliverStatus) { *out = *in - if in.ErrorChannel != nil { - in, out := &in.ErrorChannel, &out.ErrorChannel + if in.DeadLetterChannel != nil { + in, out := &in.DeadLetterChannel, &out.DeadLetterChannel *out = new(v1.ObjectReference) **out = **in } @@ -218,8 +218,8 @@ func (in *DeliverStatus) DeepCopy() *DeliverStatus { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeliverySpec) DeepCopyInto(out *DeliverySpec) { *out = *in - if in.ErrorSink != nil { - in, out := &in.ErrorSink, &out.ErrorSink + if in.DeadLetterSink != nil { + in, out := &in.DeadLetterSink, &out.DeadLetterSink *out = new(apisv1alpha1.Destination) (*in).DeepCopyInto(*out) } From ab4a9aa2f2115cd046ed30ef84309aa3bd5a2b40 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Mon, 30 Sep 2019 10:01:51 -0400 Subject: [PATCH 08/10] deadLetterSink can be one per subscriber --- docs/delivery/README.md | 10 ++++++---- docs/delivery/imc-one-per-subcriber.yaml | 16 ++++++++++++++++ docs/delivery/imc.yaml | 8 +++----- 3 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 docs/delivery/imc-one-per-subcriber.yaml diff --git a/docs/delivery/README.md b/docs/delivery/README.md index 9a2f46fd53e..eaca34c559a 100644 --- a/docs/delivery/README.md +++ b/docs/delivery/README.md @@ -25,13 +25,15 @@ underlying platform (eg. RabbitMQ dead letter exchange, Amazon SQS dead letter q ### Dead Letter Sink -Channels are responsible for forwarding received events to subscribers. When they fail to do so, they are responsible for sending the failing events to an **dead letter sink**. It could be a channel but it does not have to. +Channels are responsible for forwarding received events to subscribers. When they fail to do so, they are responsible for sending the failing events to an **dead letter sink**, potentially one per subscriber. Similarly Event Sources are responsible for sending events to a sink and when they fail to do so, they are responsible for sending the failing events to an **dead letter sink**. +The dead letter sink can be a channel but it does not have to. + ### Dead-Letter Channel -Knative Channel implementations may leverage existing platform native error handling support they might provide, like a a [_Dead Letter Channel_](https://www.enterpriseintegrationpatterns.com/patterns/messaging/DeadLetterChannel.html), to forward failed events from their _Dead Letter Channel_ to the configured error sink. +Knative Channel implementations may leverage existing platform native error handling support they might provide, like [_Dead Letter Channel_](https://www.enterpriseintegrationpatterns.com/patterns/messaging/DeadLetterChannel.html), to forward failed events from their _Dead Letter Channel_ to the configured error sink(s). ### Retry @@ -58,7 +60,7 @@ type DeliverySpec struct { DeadLetterSink *apisv1alpha1.Destination `json:"deadLetterSink,omitempty"` // Retry is the minimum number of retries the sender should attempt when - // sending av event before moving it to the dead letter sink + // sending a event before moving it to the dead letter sink // +optional Retry *int32 `json:"retry,omitempty"` @@ -87,7 +89,7 @@ const ( ) ``` -Channel, brokers and event sources are not required to support all this capabilities and are free to add more delivery options. +Channel, brokers and event sources are not required to support all these capabilities and are free to add more delivery options. ### Exposing underlying DLC diff --git a/docs/delivery/imc-one-per-subcriber.yaml b/docs/delivery/imc-one-per-subcriber.yaml new file mode 100644 index 00000000000..e1b0fc33dfd --- /dev/null +++ b/docs/delivery/imc-one-per-subcriber.yaml @@ -0,0 +1,16 @@ +apiVersion: messaging.knative.dev/v1alpha1 +kind: InMemoryChannel +metadata: + name: imc +spec: + # Channel delivery configuration + delivery: + retry: 5 + backoffPolicy: exponential + backoffDelay: 3s + subscribable: # populated by Subscription + subscribers: + - subscriberURI: mysub.default.svc.cluster.local + delivery: + deadLetterSinkURI: mydls.default.svc.cluster.local + diff --git a/docs/delivery/imc.yaml b/docs/delivery/imc.yaml index 60203320292..f5e0a72c51e 100644 --- a/docs/delivery/imc.yaml +++ b/docs/delivery/imc.yaml @@ -11,9 +11,7 @@ spec: retry: 5 backoffPolicy: exponential backoffDelay: 3s - subscribable: + subscribable: # populated by Subscription subscribers: - - ref: - apiVersion: messaging.knative.dev/v1alpha1 - kind: Subscription - name: subscriber + - subscriberURI: mysub.default.svc.cluster.local + From e1543122702fc4d44c8c21add520c291572b032d Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Thu, 10 Oct 2019 09:34:15 -0400 Subject: [PATCH 09/10] fixes after review --- docs/delivery/README.md | 6 +-- pkg/apis/duck/v1alpha1/delivery_types.go | 6 +-- .../duck/v1alpha1/zz_generated.deepcopy.go | 42 +++++++++---------- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/docs/delivery/README.md b/docs/delivery/README.md index eaca34c559a..f4c5dd0a058 100644 --- a/docs/delivery/README.md +++ b/docs/delivery/README.md @@ -72,7 +72,7 @@ type DeliverySpec struct { // More information on Duration format: https://www.ietf.org/rfc/rfc3339.txt // // For linear policy, backoff delay is the time interval between retries. - // For exponential policy , backoff delay is backoffDelay*10^ + // For exponential policy , backoff delay is backoffDelay*2^ // +optional BackoffDelay *string } @@ -97,8 +97,8 @@ Channel implementation supporting dead letter channel should advertise it in the ```go -// DeliverStatus contains the Status of an object supporting delivery options. -type DeliverStatus struct { +// DeliveryStatus contains the Status of an object supporting delivery options. +type DeliveryStatus struct { // DeadLetterChannel is the reference to the native, platform specific channel where failed events are sent to. // +optional DeadLetterChannel *corev1.ObjectReference `json:"deadLetterChannel,omitempty"` diff --git a/pkg/apis/duck/v1alpha1/delivery_types.go b/pkg/apis/duck/v1alpha1/delivery_types.go index 81ab277c24c..8a829be7ab1 100644 --- a/pkg/apis/duck/v1alpha1/delivery_types.go +++ b/pkg/apis/duck/v1alpha1/delivery_types.go @@ -42,7 +42,7 @@ type DeliverySpec struct { // More information on Duration format: https://www.ietf.org/rfc/rfc3339.txt // // For linear policy, backoff delay is the time interval between retries. - // For exponential policy , backoff delay is backoffDelay*10^ + // For exponential policy , backoff delay is backoffDelay*2^ // +optional BackoffDelay *string } @@ -58,8 +58,8 @@ const ( BackoffPolicyExponential BackoffPolicyType = "exponential" ) -// DeliverStatus contains the Status of an object supporting delivery options. -type DeliverStatus struct { +// DeliveryStatus contains the Status of an object supporting delivery options. +type DeliveryStatus struct { // DeadLetterChannel is the reference to the native, platform specific channel // where failed events are sent to. // +optional diff --git a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go index 68ac28ffa44..93dcab3ce34 100644 --- a/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go +++ b/pkg/apis/duck/v1alpha1/zz_generated.deepcopy.go @@ -194,27 +194,6 @@ func (in *ChannelableStatus) DeepCopy() *ChannelableStatus { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *DeliverStatus) DeepCopyInto(out *DeliverStatus) { - *out = *in - if in.DeadLetterChannel != nil { - in, out := &in.DeadLetterChannel, &out.DeadLetterChannel - *out = new(v1.ObjectReference) - **out = **in - } - return -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeliverStatus. -func (in *DeliverStatus) DeepCopy() *DeliverStatus { - if in == nil { - return nil - } - out := new(DeliverStatus) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *DeliverySpec) DeepCopyInto(out *DeliverySpec) { *out = *in @@ -251,6 +230,27 @@ func (in *DeliverySpec) DeepCopy() *DeliverySpec { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *DeliveryStatus) DeepCopyInto(out *DeliveryStatus) { + *out = *in + if in.DeadLetterChannel != nil { + in, out := &in.DeadLetterChannel, &out.DeadLetterChannel + *out = new(v1.ObjectReference) + **out = **in + } + return +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeliveryStatus. +func (in *DeliveryStatus) DeepCopy() *DeliveryStatus { + if in == nil { + return nil + } + out := new(DeliveryStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *Resource) DeepCopyInto(out *Resource) { *out = *in From a5d784c8cd6b01fd7a13366179ac81560fcb80c8 Mon Sep 17 00:00:00 2001 From: Lionel Villard Date: Tue, 29 Oct 2019 13:12:30 -0400 Subject: [PATCH 10/10] rebase --- pkg/apis/duck/v1alpha1/channelable_types.go | 2 +- pkg/apis/duck/v1alpha1/channelable_types_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/apis/duck/v1alpha1/channelable_types.go b/pkg/apis/duck/v1alpha1/channelable_types.go index 957ff762a41..778ec808d95 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types.go +++ b/pkg/apis/duck/v1alpha1/channelable_types.go @@ -95,7 +95,7 @@ func (c *Channelable) Populate() { delay := "5s" c.Spec.Delivery = &DeliverySpec{ DeadLetterSink: &apisv1alpha1.Destination{ - ObjectReference: &corev1.ObjectReference{ + Ref: &corev1.ObjectReference{ Name: "aname", }, URI: &apis.URL{ diff --git a/pkg/apis/duck/v1alpha1/channelable_types_test.go b/pkg/apis/duck/v1alpha1/channelable_types_test.go index 0374a202739..2e22b40fe53 100644 --- a/pkg/apis/duck/v1alpha1/channelable_types_test.go +++ b/pkg/apis/duck/v1alpha1/channelable_types_test.go @@ -63,7 +63,7 @@ func TestChannelablePopulate(t *testing.T) { }, Delivery: &DeliverySpec{ DeadLetterSink: &apisv1alpha1.Destination{ - ObjectReference: &corev1.ObjectReference{ + Ref: &corev1.ObjectReference{ Name: "aname", }, URI: &apis.URL{