Repository: knative-sandbox/eventing-kafka
Pull request #895 (2021-09-27 19:48:31)

[Channel] Set defaults of spec.delivery
Like https://github.com/knative/eventing/pull/5748 but for KafkaChannel.

## Proposed Changes

- [Channel] Set defaults of spec.delivery
- Upgrade eventing to main `go get -u knative.dev/eventing@main`
- Add delete permissions to channelable manipulator cluster role
  - Eventing controller needs to delete channels when a step in
a sequence is removed.
    - knative/eventing#5718

**Release Note**

<!--
🗒️ If this change has user-visible impact, write a release note in the block
below. Include the string "action required" if additional action is required of
users switching to the new release, for example in case of a breaking change.

Write as if you are speaking to users, not other Knative contributors. If this
change has no user-visible impact, no release-note is needed.
-->

```release-note
The field `spec.delivery.deadLetterSink.ref.namespace` for KafkaChannel if not specified is defaulted to `metadata.namespace`.
```

/kind enhancement
/assign @aliok @matzew 

knative-prow-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/eventing-kafka/pull/895#" title="Author self-approved">pierDipi</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please assign **rhuss** after the PR has been reviewed.
You can assign the PR to them by writing `/assign @rhuss` in a comment when ready.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative-sandbox%2Feventing-kafka).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/knative-sandbox/eventing-kafka/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["rhuss"]} -->
codecov[bot]: # [Codecov](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) Report
> Merging [#895](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) (57092aa) into [main](https://codecov.io/gh/knative-sandbox/eventing-kafka/commit/ee10746f4df38a2be2db60b1d739356fe1dcdf9e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) (ee10746) will **increase** coverage by `0.00%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895/graphs/tree.svg?width=650&height=150&src=pr&token=W765CT93QC&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox)](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox)

```diff
@@           Coverage Diff           @@
##             main     #895   +/-   ##
=======================================
  Coverage   74.61%   74.62%           
=======================================
  Files         154      154           
  Lines        7177     7179    +2     
=======================================
+ Hits         5355     5357    +2     
  Misses       1533     1533           
  Partials      289      289           
```


| [Impacted Files](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) | Coverage Δ | |
|---|---|---|
| [...g/apis/messaging/v1beta1/kafka\_channel\_defaults.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL2FwaXMvbWVzc2FnaW5nL3YxYmV0YTEva2Fma2FfY2hhbm5lbF9kZWZhdWx0cy5nbw==) | `100.00% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox). Last update [ee10746...57092aa](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/895?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox).

knative-prow-robot: @pierDipi: The following test **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-knative-sandbox-eventing-kafka-integration-test-channel-consolidated | 57092aacc99e9df3f28ba399d47340e9b7559d33 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka/895/pull-knative-sandbox-eventing-kafka-integration-test-channel-consolidated/1442576912290418688) | true | `/test pull-knative-sandbox-eventing-kafka-integration-test-channel-consolidated`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_eventing-kafka/895). [Your PR dashboard](https://gubernator.knative.dev/pr/pierDipi).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-prow-robot: @pierDipi: The following tests **failed**, say `/retest` to rerun all failed tests or `/retest-required` to rerun all mandatory failed tests:

Test name | Commit | Details | Required | Rerun command
--- | --- | --- | --- | ---
pull-knative-sandbox-eventing-kafka-integration-test-channel-consolidated | 57092aacc99e9df3f28ba399d47340e9b7559d33 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka/895/pull-knative-sandbox-eventing-kafka-integration-test-channel-consolidated/1442576912290418688) | true | `/test pull-knative-sandbox-eventing-kafka-integration-test-channel-consolidated`
pull-knative-sandbox-eventing-kafka-integration-test-channel-distributed | 57092aacc99e9df3f28ba399d47340e9b7559d33 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka/895/pull-knative-sandbox-eventing-kafka-integration-test-channel-distributed/1442576912416247808) | true | `/test pull-knative-sandbox-eventing-kafka-integration-test-channel-distributed`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_eventing-kafka/895). [Your PR dashboard](https://gubernator.knative.dev/pr/pierDipi).

<details>

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md).  If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
</details>
<!-- test report -->
knative-prow-robot: [APPROVALNOTIFIER] This PR is **NOT APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/eventing-kafka/pull/895#" title="Author self-approved">pierDipi</a>*
To complete the [pull request process](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process), please ask for approval from **aliok** after the PR has been reviewed.

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative-sandbox%2Feventing-kafka).

<details open>
Needs approval from an approver in each of these files:

- **[OWNERS](https://github.com/knative-sandbox/eventing-kafka/blob/main/OWNERS)**

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":["aliok"]} -->
knative-prow-robot: [APPROVALNOTIFIER] This PR is **APPROVED**

This pull-request has been approved by: *<a href="https://github.com/knative-sandbox/eventing-kafka/pull/895#pullrequestreview-765312691" title="Approved">matzew</a>*, *<a href="https://github.com/knative-sandbox/eventing-kafka/pull/895#" title="Author self-approved">pierDipi</a>*

The full list of commands accepted by this bot can be found [here](https://go.k8s.io/bot-commands?repo=knative-sandbox%2Feventing-kafka).

The pull request process is described [here](https://git.k8s.io/community/contributors/guide/owners.md#the-code-review-process)

<details >
Needs approval from an approver in each of these files:

- ~~[OWNERS](https://github.com/knative-sandbox/eventing-kafka/blob/main/OWNERS)~~ [matzew]

Approvers can indicate their approval by writing `/approve` in a comment
Approvers can cancel approval by writing `/approve cancel` in a comment
</details>
<!-- META={"approvers":[]} -->

Patch:
diff --git a/.gitignore b/.gitignore
index 38cca5ec8..e112dc085 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,6 +2,7 @@
 *.iml
 .idea/
 .run/
+.vscode/
 
 # System Files
 .DS_Store
diff --git a/config/channel/consolidated/roles/channelable-manipulator-clusterrole.yaml b/config/channel/consolidated/roles/channelable-manipulator-clusterrole.yaml
index a927bf79f..fa4e72094 100644
--- a/config/channel/consolidated/roles/channelable-manipulator-clusterrole.yaml
+++ b/config/channel/consolidated/roles/channelable-manipulator-clusterrole.yaml
@@ -33,3 +33,5 @@ rules:
       - watch
       - update
       - patch
+      - delete
+
diff --git a/config/channel/distributed/100-channelable-manipulator-clusterrole.yaml b/config/channel/distributed/100-channelable-manipulator-clusterrole.yaml
index 5f0246a26..5fbffd8eb 100644
--- a/config/channel/distributed/100-channelable-manipulator-clusterrole.yaml
+++ b/config/channel/distributed/100-channelable-manipulator-clusterrole.yaml
@@ -32,3 +32,4 @@ rules:
   - watch
   - update
   - patch
+  - delete
diff --git a/go.mod b/go.mod
index 05ff5a8a2..5f0f8c845 100644
--- a/go.mod
+++ b/go.mod
@@ -35,7 +35,7 @@ require (
 	k8s.io/client-go v0.21.4
 	k8s.io/utils v0.0.0-20201110183641-67b214c5f920
 	knative.dev/control-protocol v0.0.0-20210916135140-1d339f445c6e
-	knative.dev/eventing v0.26.0
+	knative.dev/eventing v0.26.1-0.20210927180711-ce818dc4a083
 	knative.dev/hack v0.0.0-20210806075220-815cd312d65c
 	knative.dev/networking v0.0.0-20210914225408-69ad45454096
 	knative.dev/pkg v0.0.0-20210919202233-5ae482141474
diff --git a/go.sum b/go.sum
index 99fb3482a..c7ce98c4b 100644
--- a/go.sum
+++ b/go.sum
@@ -1191,8 +1191,8 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g
 k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
 knative.dev/control-protocol v0.0.0-20210916135140-1d339f445c6e h1:xmXtgWZL0XWp5J5qDK3Ln/HLBCV5LBqGw6lTuEP2al4=
 knative.dev/control-protocol v0.0.0-20210916135140-1d339f445c6e/go.mod h1:OFhIUB64BOJ/qh4DHiM3nHJhZ8cAdD569gW6Srpk5UU=
-knative.dev/eventing v0.26.0 h1:osDUdav7S0FuChN0onfwL5cEcsdb54Kee2hjAPMpY7o=
-knative.dev/eventing v0.26.0/go.mod h1:6tTam0lsPtBSJHJ63/195obj2VAHlTZZB7TLiBSeqk0=
+knative.dev/eventing v0.26.1-0.20210927180711-ce818dc4a083 h1:lhxzPEChs9NpQIpIaDgBSljGbLRoyoSJ9jdut4Dn9Bc=
+knative.dev/eventing v0.26.1-0.20210927180711-ce818dc4a083/go.mod h1:6tTam0lsPtBSJHJ63/195obj2VAHlTZZB7TLiBSeqk0=
 knative.dev/hack v0.0.0-20210806075220-815cd312d65c h1:nOXoDWAAItwr4o0dp3nHr6skgpVD4IvME/UX84YNl5k=
 knative.dev/hack v0.0.0-20210806075220-815cd312d65c/go.mod h1:PHt8x8yX5Z9pPquBEfIj0X66f8iWkWfR0S/sarACJrI=
 knative.dev/hack/schema v0.0.0-20210806075220-815cd312d65c/go.mod h1:ffjwmdcrH5vN3mPhO8RrF2KfNnbHeCE2C60A+2cv3U0=
diff --git a/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go b/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go
index 68a82bea7..2748ccfc4 100644
--- a/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go
+++ b/pkg/apis/messaging/v1beta1/kafka_channel_defaults.go
@@ -20,6 +20,7 @@ import (
 	"context"
 
 	"knative.dev/eventing/pkg/apis/messaging"
+	"knative.dev/pkg/apis"
 
 	"knative.dev/eventing-kafka/pkg/common/constants"
 )
@@ -38,6 +39,7 @@ func (kc *KafkaChannel) SetDefaults(ctx context.Context) {
 		kc.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1"
 	}
 
+	ctx = apis.WithinParent(ctx, kc.ObjectMeta)
 	kc.Spec.SetDefaults(ctx)
 }
 
@@ -51,4 +53,5 @@ func (kcs *KafkaChannelSpec) SetDefaults(ctx context.Context) {
 	if len(kcs.RetentionDuration) <= 0 {
 		kcs.RetentionDuration = constants.DefaultRetentionISO8601Duration
 	}
+	kcs.Delivery.SetDefaults(ctx)
 }
diff --git a/vendor/knative.dev/eventing/pkg/apis/duck/v1/channelable_types.go b/vendor/knative.dev/eventing/pkg/apis/duck/v1/channelable_types.go
index 2d03a3f87..39784fcaf 100644
--- a/vendor/knative.dev/eventing/pkg/apis/duck/v1/channelable_types.go
+++ b/vendor/knative.dev/eventing/pkg/apis/duck/v1/channelable_types.go
@@ -63,8 +63,13 @@ type ChannelableStatus struct {
 	duckv1.AddressStatus `json:",inline"`
 	// Subscribers is populated with the statuses of each of the Channelable's subscribers.
 	SubscribableStatus `json:",inline"`
+	// DeliveryStatus contains a resolved URL to the dead letter sink address, and any other
+	// resolved delivery options.
+	// +optional
+	DeliveryStatus `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 in favor of DeliveryStatus, to be removed September 2022.
 	// +optional
 	DeadLetterChannel *duckv1.KReference `json:"deadLetterChannel,omitempty"`
 }
diff --git a/vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_defaults.go b/vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_defaults.go
new file mode 100644
index 000000000..b06c792ef
--- /dev/null
+++ b/vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_defaults.go
@@ -0,0 +1,28 @@
+/*
+Copyright 2021 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 v1
+
+import "context"
+
+func (ds *DeliverySpec) SetDefaults(ctx context.Context) {
+	if ds == nil {
+		return
+	}
+	if ds.DeadLetterSink != nil {
+		ds.DeadLetterSink.SetDefaults(ctx)
+	}
+}
diff --git a/vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_types.go b/vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_types.go
index b82bbc4f9..dffd0397a 100644
--- a/vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_types.go
+++ b/vendor/knative.dev/eventing/pkg/apis/duck/v1/delivery_types.go
@@ -115,10 +115,10 @@ const (
 	BackoffPolicyExponential BackoffPolicyType = "exponential"
 )
 
-// DeliveryStatus contains the Status of an object supporting delivery options.
+// DeliveryStatus contains the Status of an object supporting delivery options. This type is intended to be embedded into a status struct.
 type DeliveryStatus struct {
-	// DeadLetterChannel is a KReference that is the reference to the native, platform specific channel
+	// DeadLetterSink 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"`
+	DeadLetterSinkURI *apis.URL `json:"deadLetterSinkUri,omitempty"`
 }
diff --git a/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go
index 0501d0e60..ffd6985ae 100644
--- a/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/eventing/pkg/apis/duck/v1/zz_generated.deepcopy.go
@@ -115,6 +115,7 @@ func (in *ChannelableStatus) DeepCopyInto(out *ChannelableStatus) {
 	in.Status.DeepCopyInto(&out.Status)
 	in.AddressStatus.DeepCopyInto(&out.AddressStatus)
 	in.SubscribableStatus.DeepCopyInto(&out.SubscribableStatus)
+	in.DeliveryStatus.DeepCopyInto(&out.DeliveryStatus)
 	if in.DeadLetterChannel != nil {
 		in, out := &in.DeadLetterChannel, &out.DeadLetterChannel
 		*out = new(duckv1.KReference)
@@ -177,10 +178,10 @@ func (in *DeliverySpec) DeepCopy() *DeliverySpec {
 // 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
+	if in.DeadLetterSinkURI != nil {
+		in, out := &in.DeadLetterSinkURI, &out.DeadLetterSinkURI
+		*out = new(apis.URL)
+		(*in).DeepCopyInto(*out)
 	}
 	return
 }
diff --git a/vendor/knative.dev/eventing/pkg/apis/duck/v1beta1/delivery_conversion.go b/vendor/knative.dev/eventing/pkg/apis/duck/v1beta1/delivery_conversion.go
index d48ccde0c..b6ec90337 100644
--- a/vendor/knative.dev/eventing/pkg/apis/duck/v1beta1/delivery_conversion.go
+++ b/vendor/knative.dev/eventing/pkg/apis/duck/v1beta1/delivery_conversion.go
@@ -76,24 +76,4 @@ func (sink *DeliverySpec) ConvertFrom(ctx context.Context, from apis.Convertible
 	}
 }
 
-// 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)
-	}
-}
+// DeliveryStatus v1beta1 is not convertable to v1 (Channel ref type vs URL)
diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_defaults.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_defaults.go
index 468964bb6..e101713e7 100644
--- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_defaults.go
+++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_defaults.go
@@ -21,9 +21,10 @@ import (
 
 	eventingduckv1 "knative.dev/eventing/pkg/apis/duck/v1"
 
+	"knative.dev/pkg/apis"
+
 	"knative.dev/eventing/pkg/apis/config"
 	"knative.dev/eventing/pkg/apis/eventing"
-	"knative.dev/pkg/apis"
 )
 
 func (b *Broker) SetDefaults(ctx context.Context) {
@@ -53,4 +54,5 @@ func (bs *BrokerSpec) SetDefaults(ctx context.Context) {
 	if bs.Config != nil {
 		bs.Config.SetDefaults(ctx)
 	}
+	bs.Delivery.SetDefaults(ctx)
 }
diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go
index d03749bd1..d12e58680 100644
--- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go
+++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/broker_types.go
@@ -92,6 +92,10 @@ type BrokerStatus struct {
 	// delivered into the Broker mesh.
 	// +optional
 	Address duckv1.Addressable `json:"address,omitempty"`
+
+	// DeliveryStatus contains a resolved URL to the dead letter sink address, and any other
+	// resolved delivery options.
+	eventingduckv1.DeliveryStatus `json:",inline"`
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_defaults.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_defaults.go
index 4c90811f3..1dde6bab9 100644
--- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_defaults.go
+++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_defaults.go
@@ -39,6 +39,7 @@ func (ts *TriggerSpec) SetDefaults(ctx context.Context) {
 	}
 	// Default the Subscriber namespace
 	ts.Subscriber.SetDefaults(ctx)
+	ts.Delivery.SetDefaults(ctx)
 }
 
 func setLabels(t *Trigger) {
diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_types.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_types.go
index d7b876c86..aa842be3f 100644
--- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_types.go
+++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/trigger_types.go
@@ -120,9 +120,9 @@ type TriggerStatus struct {
 	// +optional
 	SubscriberURI *apis.URL `json:"subscriberUri,omitempty"`
 
-	// DeadLetterSinkURI is the resolved URI of the dead letter sink for this Trigger.
-	// +optional
-	DeadLetterSinkURI *apis.URL `json:"deadLetterSinkUri,omitempty"`
+	// DeliveryStatus contains a resolved URL to the dead letter sink address, and any other
+	// resolved delivery options.
+	eventingduckv1.DeliveryStatus `json:",inline"`
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go
index 908b4e354..bc1223f04 100644
--- a/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/eventing/pkg/apis/eventing/v1/zz_generated.deepcopy.go
@@ -119,6 +119,7 @@ func (in *BrokerStatus) DeepCopyInto(out *BrokerStatus) {
 	*out = *in
 	in.Status.DeepCopyInto(&out.Status)
 	in.Address.DeepCopyInto(&out.Address)
+	in.DeliveryStatus.DeepCopyInto(&out.DeliveryStatus)
 	return
 }
 
@@ -274,11 +275,7 @@ func (in *TriggerStatus) DeepCopyInto(out *TriggerStatus) {
 		*out = new(apis.URL)
 		(*in).DeepCopyInto(*out)
 	}
-	if in.DeadLetterSinkURI != nil {
-		in, out := &in.DeadLetterSinkURI, &out.DeadLetterSinkURI
-		*out = new(apis.URL)
-		(*in).DeepCopyInto(*out)
-	}
+	in.DeliveryStatus.DeepCopyInto(&out.DeliveryStatus)
 	return
 }
 
diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/channel_defaults.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/channel_defaults.go
index 82746cdd4..682e4d171 100644
--- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/channel_defaults.go
+++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/channel_defaults.go
@@ -19,9 +19,10 @@ package v1
 import (
 	"context"
 
+	"knative.dev/pkg/apis"
+
 	"knative.dev/eventing/pkg/apis/messaging"
 	"knative.dev/eventing/pkg/apis/messaging/config"
-	"knative.dev/pkg/apis"
 )
 
 func (c *Channel) SetDefaults(ctx context.Context) {
@@ -48,6 +49,7 @@ func (cs *ChannelSpec) SetDefaults(ctx context.Context) {
 			c.Spec,
 		}
 	}
+	cs.Delivery.SetDefaults(ctx)
 }
 
 // ChannelDefaulter sets the default Channel CRD and Arguments on Channels that do not
diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_defaults.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_defaults.go
index a081d6bb6..a3f3bedff 100644
--- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_defaults.go
+++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/in_memory_channel_defaults.go
@@ -19,6 +19,8 @@ package v1
 import (
 	"context"
 
+	"knative.dev/pkg/apis"
+
 	"knative.dev/eventing/pkg/apis/messaging"
 )
 
@@ -35,9 +37,10 @@ func (imc *InMemoryChannel) SetDefaults(ctx context.Context) {
 		imc.Annotations[messaging.SubscribableDuckVersionAnnotation] = "v1"
 	}
 
+	ctx = apis.WithinParent(ctx, imc.ObjectMeta)
 	imc.Spec.SetDefaults(ctx)
 }
 
 func (imcs *InMemoryChannelSpec) SetDefaults(ctx context.Context) {
-	// TODO: Nothing to default here...
+	imcs.Delivery.SetDefaults(ctx)
 }
diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_defaults.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_defaults.go
index 2beb73d00..0e894fc63 100644
--- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_defaults.go
+++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_defaults.go
@@ -18,10 +18,21 @@ package v1
 
 import (
 	"context"
+
+	"knative.dev/pkg/apis"
 )
 
 func (s *Subscription) SetDefaults(ctx context.Context) {
+	if s == nil {
+		return
+	}
+	ctx = apis.WithinParent(ctx, s.ObjectMeta)
 	s.Spec.SetDefaults(ctx)
 }
 
-func (ss *SubscriptionSpec) SetDefaults(ctx context.Context) {}
+func (ss *SubscriptionSpec) SetDefaults(ctx context.Context) {
+	if ss == nil {
+		return
+	}
+	ss.Delivery.SetDefaults(ctx)
+}
diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_types.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_types.go
index b093269d9..4bd637cbe 100644
--- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_types.go
+++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/subscription_types.go
@@ -128,9 +128,9 @@ type SubscriptionStatusPhysicalSubscription struct {
 	// +optional
 	ReplyURI *apis.URL `json:"replyUri,omitempty"`
 
-	// ReplyURI is the fully resolved URI for the spec.delivery.deadLetterSink.
-	// +optional
-	DeadLetterSinkURI *apis.URL `json:"deadLetterSinkUri,omitempty"`
+	// DeliveryStatus contains a resolved URL to the dead letter sink address, and any other
+	// resolved delivery options.
+	eventingduckv1.DeliveryStatus `json:",inline"`
 }
 
 // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
diff --git a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go
index 752f11d6e..dd7561922 100644
--- a/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go
+++ b/vendor/knative.dev/eventing/pkg/apis/messaging/v1/zz_generated.deepcopy.go
@@ -381,11 +381,7 @@ func (in *SubscriptionStatusPhysicalSubscription) DeepCopyInto(out *Subscription
 		*out = new(apis.URL)
 		(*in).DeepCopyInto(*out)
 	}
-	if in.DeadLetterSinkURI != nil {
-		in, out := &in.DeadLetterSinkURI, &out.DeadLetterSinkURI
-		*out = new(apis.URL)
-		(*in).DeepCopyInto(*out)
-	}
+	in.DeliveryStatus.DeepCopyInto(&out.DeliveryStatus)
 	return
 }
 
diff --git a/vendor/modules.txt b/vendor/modules.txt
index 77bd1fe7a..dec9af889 100644
--- a/vendor/modules.txt
+++ b/vendor/modules.txt
@@ -1110,7 +1110,7 @@ knative.dev/control-protocol/pkg/message
 knative.dev/control-protocol/pkg/network
 knative.dev/control-protocol/pkg/reconciler
 knative.dev/control-protocol/pkg/service
-# knative.dev/eventing v0.26.0
+# knative.dev/eventing v0.26.1-0.20210927180711-ce818dc4a083
 ## explicit
 knative.dev/eventing/pkg/adapter/v2
 knative.dev/eventing/pkg/adapter/v2/test


Test patch:
diff --git a/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go b/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go
index 9e5092c4c..05ed4bfc7 100644
--- a/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go
+++ b/pkg/apis/messaging/v1beta1/kafka_channel_defaults_test.go
@@ -20,6 +20,9 @@ import (
 	"github.com/google/go-cmp/cmp"
 	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
 
+	eventingduck "knative.dev/eventing/pkg/apis/duck/v1"
+	duck "knative.dev/pkg/apis/duck/v1"
+
 	"knative.dev/eventing-kafka/pkg/common/constants"
 )
 
@@ -101,6 +104,55 @@ func TestKafkaChannelDefaults(t *testing.T) {
 				},
 			},
 		},
+		"delivery.deadLetterSink.ref.namespace not set": {
+			initial: KafkaChannel{
+				ObjectMeta: metav1.ObjectMeta{
+					Namespace:   "custom",
+					Name:        "ch",
+					Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1"},
+				},
+				Spec: KafkaChannelSpec{
+					NumPartitions:     testNumPartitions,
+					ReplicationFactor: testReplicationFactor,
+					RetentionDuration: constants.DefaultRetentionISO8601Duration,
+					ChannelableSpec: eventingduck.ChannelableSpec{
+						Delivery: &eventingduck.DeliverySpec{
+							DeadLetterSink: &duck.Destination{
+								Ref: &duck.KReference{
+									APIVersion: "v1",
+									Name:       "svc",
+									Kind:       "Service",
+								},
+							},
+						},
+					},
+				},
+			},
+			expected: KafkaChannel{
+				ObjectMeta: metav1.ObjectMeta{
+					Namespace:   "custom",
+					Name:        "ch",
+					Annotations: map[string]string{"messaging.knative.dev/subscribable": "v1"},
+				},
+				Spec: KafkaChannelSpec{
+					NumPartitions:     testNumPartitions,
+					ReplicationFactor: testReplicationFactor,
+					RetentionDuration: constants.DefaultRetentionISO8601Duration,
+					ChannelableSpec: eventingduck.ChannelableSpec{
+						Delivery: &eventingduck.DeliverySpec{
+							DeadLetterSink: &duck.Destination{
+								Ref: &duck.KReference{
+									APIVersion: "v1",
+									Name:       "svc",
+									Namespace:  "custom",
+									Kind:       "Service",
+								},
+							},
+						},
+					},
+				},
+			},
+		},
 	}
 	for n, tc := range testCases {
 		t.Run(n, func(t *testing.T) {
diff --git a/vendor/knative.dev/eventing/test/conformance/helpers/channel_channelable_manipulator_cluster_role_test_helper.go b/vendor/knative.dev/eventing/test/conformance/helpers/channel_channelable_manipulator_cluster_role_test_helper.go
index 791087f6d..507545318 100644
--- a/vendor/knative.dev/eventing/test/conformance/helpers/channel_channelable_manipulator_cluster_role_test_helper.go
+++ b/vendor/knative.dev/eventing/test/conformance/helpers/channel_channelable_manipulator_cluster_role_test_helper.go
@@ -38,7 +38,7 @@ func TestChannelChannelableManipulatorClusterRoleTestRunner(
 ) {
 
 	const aggregationClusterRoleName = "channelable-manipulator"
-	var permissionTestCaseVerbs = []string{"get", "list", "watch", "update", "patch"}
+	var permissionTestCaseVerbs = []string{"get", "list", "watch", "update", "patch", "delete"}
 
 	channelTestRunner.RunTests(t, testlib.FeatureBasic, func(st *testing.T, channel metav1.TypeMeta) {
 		client := testlib.Setup(st, true, options...)