From 93c6d56a34327cb0def398f8c58e2303a5ef3c8a Mon Sep 17 00:00:00 2001
From: Evan Anderson DeadLetterChannel is a KReference and is set by the channel when it supports native error handling via a channel
-Failed messages are delivered here. DeadLetterSinkUri is the resolved URI of the dead letter sink.
(Optional)
+
+
+
@@ -372,36 +387,6 @@ For exponential policy, backoff delay is backoffDelay*2^
+
+deadLetterSinkUri
+
+
+knative.dev/pkg/apis.URL
+
+
+
+(Optional)
+
-
DeliveryStatus contains the Status of an object supporting delivery options.
- -| Field | -Description | -
|---|---|
-deadLetterChannel- - -knative.dev/pkg/apis/duck/v1.KReference - - - |
-
-(Optional)
- DeadLetterChannel is a KReference that is the reference to the native, platform specific channel -where failed events are sent to. - |
-
diff --git a/pkg/apis/duck/v1/channelable_types.go b/pkg/apis/duck/v1/channelable_types.go
index 2d03a3f879c..65a3625559c 100644
--- a/pkg/apis/duck/v1/channelable_types.go
+++ b/pkg/apis/duck/v1/channelable_types.go
@@ -65,8 +65,12 @@ type ChannelableStatus struct {
SubscribableStatus `json:",inline"`
// DeadLetterChannel is a KReference and is set by the channel when it supports native error handling via a channel
// Failed messages are delivered here.
+ // Deprecated, see DeadLetterSinkUri insteam
// +optional
DeadLetterChannel *duckv1.KReference `json:"deadLetterChannel,omitempty"`
+ // DeadLetterSinkUri is the resolved URI of the dead letter sink.
+ // +optional
+ DeadLetterSinkURI *apis.URL `json:"deadLetterSinkUri,omitempty"`
}
var (
diff --git a/pkg/apis/duck/v1/delivery_conversion.go b/pkg/apis/duck/v1/delivery_conversion.go
index bae7a804ec2..49fc3888dd3 100644
--- a/pkg/apis/duck/v1/delivery_conversion.go
+++ b/pkg/apis/duck/v1/delivery_conversion.go
@@ -32,13 +32,3 @@ func (source *DeliverySpec) ConvertTo(ctx context.Context, sink apis.Convertible
func (sink *DeliverySpec) ConvertFrom(ctx context.Context, source apis.Convertible) error {
return fmt.Errorf("v1 is the highest known version, got: %T", source)
}
-
-// ConvertTo implements apis.Convertible
-func (source *DeliveryStatus) ConvertTo(ctx context.Context, sink apis.Convertible) error {
- return fmt.Errorf("v1 is the highest known version, got: %T", sink)
-}
-
-// ConvertFrom implements apis.Convertible
-func (sink *DeliveryStatus) ConvertFrom(ctx context.Context, source apis.Convertible) error {
- return fmt.Errorf("v1 is the highest known version, got: %T", source)
-}
diff --git a/pkg/apis/duck/v1/delivery_conversion_test.go b/pkg/apis/duck/v1/delivery_conversion_test.go
index bc348da09cc..e13cdc9523b 100644
--- a/pkg/apis/duck/v1/delivery_conversion_test.go
+++ b/pkg/apis/duck/v1/delivery_conversion_test.go
@@ -32,15 +32,3 @@ func TestDeliverySpecConversionBadType(t *testing.T) {
t.Errorf("ConvertFrom() = %#v, wanted error", good)
}
}
-
-func TestDeliveryStatusConversionBadType(t *testing.T) {
- good, bad := &DeliveryStatus{}, &DeliveryStatus{}
-
- if err := good.ConvertTo(context.Background(), bad); err == nil {
- t.Errorf("ConvertTo() = %#v, wanted error", bad)
- }
-
- if err := good.ConvertFrom(context.Background(), bad); err == nil {
- t.Errorf("ConvertFrom() = %#v, wanted error", good)
- }
-}
diff --git a/pkg/apis/duck/v1/delivery_types.go b/pkg/apis/duck/v1/delivery_types.go
index b82bbc4f9b7..68b74552c6f 100644
--- a/pkg/apis/duck/v1/delivery_types.go
+++ b/pkg/apis/duck/v1/delivery_types.go
@@ -114,11 +114,3 @@ const (
// Exponential backoff policy
BackoffPolicyExponential BackoffPolicyType = "exponential"
)
-
-// DeliveryStatus contains the Status of an object supporting delivery options.
-type DeliveryStatus struct {
- // DeadLetterChannel is a KReference that is the reference to the native, platform specific channel
- // where failed events are sent to.
- // +optional
- DeadLetterChannel *duckv1.KReference `json:"deadLetterChannel,omitempty"`
-}
diff --git a/pkg/apis/duck/v1/zz_generated.deepcopy.go b/pkg/apis/duck/v1/zz_generated.deepcopy.go
index 0501d0e6045..c47723ef89f 100644
--- a/pkg/apis/duck/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/duck/v1/zz_generated.deepcopy.go
@@ -120,6 +120,11 @@ func (in *ChannelableStatus) DeepCopyInto(out *ChannelableStatus) {
*out = new(duckv1.KReference)
**out = **in
}
+ if in.DeadLetterSinkURI != nil {
+ in, out := &in.DeadLetterSinkURI, &out.DeadLetterSinkURI
+ *out = new(apis.URL)
+ (*in).DeepCopyInto(*out)
+ }
return
}
@@ -174,27 +179,6 @@ 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(duckv1.KReference)
- **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 *Subscribable) DeepCopyInto(out *Subscribable) {
*out = *in
diff --git a/pkg/apis/duck/v1beta1/delivery_conversion.go b/pkg/apis/duck/v1beta1/delivery_conversion.go
index d48ccde0c18..3b6d6c504a9 100644
--- a/pkg/apis/duck/v1beta1/delivery_conversion.go
+++ b/pkg/apis/duck/v1beta1/delivery_conversion.go
@@ -75,25 +75,3 @@ func (sink *DeliverySpec) ConvertFrom(ctx context.Context, from apis.Convertible
return fmt.Errorf("unknown version, got: %T", source)
}
}
-
-// ConvertTo implements apis.Convertible
-func (source *DeliveryStatus) ConvertTo(ctx context.Context, to apis.Convertible) error {
- switch sink := to.(type) {
- case *eventingduckv1.DeliveryStatus:
- sink.DeadLetterChannel = source.DeadLetterChannel
- return nil
- default:
- return fmt.Errorf("unknown version, got: %T", sink)
- }
-}
-
-// ConvertFrom implements apis.Convertible
-func (sink *DeliveryStatus) ConvertFrom(ctx context.Context, from apis.Convertible) error {
- switch source := from.(type) {
- case *eventingduckv1.DeliveryStatus:
- sink.DeadLetterChannel = source.DeadLetterChannel
- return nil
- default:
- return fmt.Errorf("unknown version, got: %T", source)
- }
-}
diff --git a/pkg/apis/duck/v1beta1/delivery_conversion_test.go b/pkg/apis/duck/v1beta1/delivery_conversion_test.go
index 7746135bf35..b5528ab2ee7 100644
--- a/pkg/apis/duck/v1beta1/delivery_conversion_test.go
+++ b/pkg/apis/duck/v1beta1/delivery_conversion_test.go
@@ -23,7 +23,6 @@ import (
"github.com/google/go-cmp/cmp"
v1 "knative.dev/eventing/pkg/apis/duck/v1"
"knative.dev/pkg/apis"
- duckv1 "knative.dev/pkg/apis/duck/v1"
pkgduck "knative.dev/pkg/apis/duck/v1"
)
@@ -39,18 +38,6 @@ func TestDeliverySpecConversionBadType(t *testing.T) {
}
}
-func TestDeliveryStatusConversionBadType(t *testing.T) {
- good, bad := &DeliveryStatus{}, &DeliveryStatus{}
-
- if err := good.ConvertTo(context.Background(), bad); err == nil {
- t.Errorf("ConvertTo() = %#v, wanted error", bad)
- }
-
- if err := good.ConvertFrom(context.Background(), bad); err == nil {
- t.Errorf("ConvertFrom() = %#v, wanted error", good)
- }
-}
-
// Test v1beta1 -> v1 -> v1beta1
func TestDeliverySpecConversion(t *testing.T) {
var retryCount int32 = 10
@@ -204,79 +191,3 @@ func TestDeliverySpecConversionV1(t *testing.T) {
})
}
}
-
-// Test v1beta1 -> v1 -> v1beta1
-func TestDeliveryStatusConversion(t *testing.T) {
- tests := []struct {
- name string
- in *DeliveryStatus
- err *string
- }{{
- name: "min configuration",
- in: &DeliveryStatus{
- DeadLetterChannel: &duckv1.KReference{
- Kind: "dlKind",
- Namespace: "dlNamespace",
- Name: "dlName",
- APIVersion: "dlAPIVersion",
- },
- },
- }}
- for _, test := range tests {
- t.Run(test.name, func(t *testing.T) {
- ver := &v1.DeliveryStatus{}
- err := test.in.ConvertTo(context.Background(), ver)
- if err != nil {
- if test.err == nil || *test.err != err.Error() {
- t.Error("ConvertTo() =", err)
- }
- return
- }
- got := &DeliveryStatus{}
- if err := got.ConvertFrom(context.Background(), ver); err != nil {
- t.Error("ConvertFrom() =", err)
- }
- if diff := cmp.Diff(test.in, got); diff != "" {
- t.Error("roundtrip (-want, +got) =", diff)
- }
- })
- }
-}
-
-// Test v1 -> v1beta1 -> v1
-func TestDeliveryStatusConversionV1(t *testing.T) {
- tests := []struct {
- name string
- in *v1.DeliveryStatus
- err *string
- }{{
- name: "min configuration",
- in: &v1.DeliveryStatus{
- DeadLetterChannel: &duckv1.KReference{
- Kind: "dlKind",
- Namespace: "dlNamespace",
- Name: "dlName",
- APIVersion: "dlAPIVersion",
- },
- },
- }}
- for _, test := range tests {
- t.Run(test.name, func(t *testing.T) {
- ver := &DeliveryStatus{}
- err := ver.ConvertFrom(context.Background(), test.in)
- if err != nil {
- if test.err == nil || *test.err != err.Error() {
- t.Error("ConvertFrom() =", err)
- }
- return
- }
- got := &v1.DeliveryStatus{}
- if err := ver.ConvertTo(context.Background(), got); err != nil {
- t.Error("ConvertTo() =", err)
- }
- if diff := cmp.Diff(test.in, got); diff != "" {
- t.Error("roundtrip (-want, +got) =", diff)
- }
- })
- }
-}
From bc4cc1d1dde5ae7d04843627953516f62ec7afc4 Mon Sep 17 00:00:00 2001
From: Evan Anderson DeadLetterChannel is a KReference and is set by the channel when it supports native error handling via a channel
-Failed messages are delivered here.
-Deprecated, see DeadLetterSinkUri insteam DeadLetterSinkUri is the resolved URI of the dead letter sink.
(Optional)
-
-
-
diff --git a/pkg/apis/duck/v1/channelable_types.go b/pkg/apis/duck/v1/channelable_types.go
index 65a3625559c..2d03a3f879c 100644
--- a/pkg/apis/duck/v1/channelable_types.go
+++ b/pkg/apis/duck/v1/channelable_types.go
@@ -65,12 +65,8 @@ type ChannelableStatus struct {
SubscribableStatus `json:",inline"`
// DeadLetterChannel is a KReference and is set by the channel when it supports native error handling via a channel
// Failed messages are delivered here.
- // Deprecated, see DeadLetterSinkUri insteam
// +optional
DeadLetterChannel *duckv1.KReference `json:"deadLetterChannel,omitempty"`
- // DeadLetterSinkUri is the resolved URI of the dead letter sink.
- // +optional
- DeadLetterSinkURI *apis.URL `json:"deadLetterSinkUri,omitempty"`
}
var (
diff --git a/pkg/apis/duck/v1/zz_generated.deepcopy.go b/pkg/apis/duck/v1/zz_generated.deepcopy.go
index c47723ef89f..814048947ed 100644
--- a/pkg/apis/duck/v1/zz_generated.deepcopy.go
+++ b/pkg/apis/duck/v1/zz_generated.deepcopy.go
@@ -120,11 +120,6 @@ func (in *ChannelableStatus) DeepCopyInto(out *ChannelableStatus) {
*out = new(duckv1.KReference)
**out = **in
}
- if in.DeadLetterSinkURI != nil {
- in, out := &in.DeadLetterSinkURI, &out.DeadLetterSinkURI
- *out = new(apis.URL)
- (*in).DeepCopyInto(*out)
- }
return
}
-
-deadLetterSinkUri
-
-
-knative.dev/pkg/apis.URL
-
-
-
-(Optional)
-