Repository: knative-sandbox/eventing-kafka
Pull request #753 (2021-07-02 20:15:58)

Initial ResetOffset Webhook
Subtask of #588 to provide optional support for ResetOffset CRDs in the existing KafkaChannel Webhook.


## Proposed Changes

- 🎁  Add check in webhook main.go for new Env Var indicating support for ResetOffset.
- 🎁  Add utility function to Webhook to add the ResetOffset CRD to the types map.
- 🎁  Add new ClusterRole for ResetOffset Webhook for future ClusterRoleBinding of Webhook.
- 🎁  Add copy of existing `webhook-deployment.yaml` including ResetOffset Env Var.

**Notes**
- The ResetOffset support is still "inactive" and has not been added to any Channels/Sources/etc.
- To enable it the following will need to be done...
    - Link the `webhook-deployment-ro.yaml` instead of the existing `webhook-deployment.yaml`
    - Link the `webhook-clusterrole.yaml`and add section to webhook clusterrolebinding yaml

**Release Note**
Release Notes will be provided near the end of the ResetOffset feature development.

**Docs**
Documentation will be provided near the end of the ResetOffset feature development.

Hold for review...
/hold 

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/753#" title="Author self-approved">travis-minke-sap</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)~~ [travis-minke-sap]

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":[]} -->
knative-metrics-robot: The following is the coverage report on the affected files.
Say `/test pull-knative-sandbox-eventing-kafka-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/channel/webhook/controller.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka/753/pull-knative-sandbox-eventing-kafka-go-coverage/1411056078740787200/artifacts/line-cov.html#file0) | Do not exist | 22.2% | 

knative-prow-robot: @travis-minke-sap: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-eventing-kafka-go-coverage | 04f39188121a17e05eaae5454c5b1ff301d78f7b | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka/753/pull-knative-sandbox-eventing-kafka-go-coverage/1411056078740787200) | `/test pull-knative-sandbox-eventing-kafka-go-coverage`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_eventing-kafka/753). [Your PR dashboard](https://gubernator.knative.dev/pr/travis-minke-sap).

<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 -->
codecov[bot]: # [Codecov](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) Report
> Merging [#753](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) (04f3918) into [main](https://codecov.io/gh/knative-sandbox/eventing-kafka/commit/000dd9c4955f4b3c3e2f71b35d30138c7d1b9770?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) (000dd9c) will **increase** coverage by `0.09%`.
> The diff coverage is `78.82%`.

[![Impacted file tree graph](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/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/753?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     #753      +/-   ##
==========================================
+ Coverage   75.29%   75.39%   +0.09%     
==========================================
  Files         132      141       +9     
  Lines        5785     6357     +572     
==========================================
+ Hits         4356     4793     +437     
- Misses       1208     1344     +136     
+ Partials      221      220       -1     
```


| [Impacted Files](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) | Coverage Δ | |
|---|---|---|
| [...onsolidated/dispatcher/consumer\_message\_handler.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL2NoYW5uZWwvY29uc29saWRhdGVkL2Rpc3BhdGNoZXIvY29uc3VtZXJfbWVzc2FnZV9oYW5kbGVyLmdv) | `0.00% <0.00%> (ø)` | |
| [.../channel/distributed/controller/util/dispatcher.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL2NoYW5uZWwvZGlzdHJpYnV0ZWQvY29udHJvbGxlci91dGlsL2Rpc3BhdGNoZXIuZ28=) | `100.00% <ø> (ø)` | |
| [pkg/source/adapter/adapter.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL3NvdXJjZS9hZGFwdGVyL2FkYXB0ZXIuZ28=) | `58.42% <ø> (-1.08%)` | :arrow_down: |
| [pkg/source/client/client.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL3NvdXJjZS9jbGllbnQvY2xpZW50Lmdv) | `15.66% <0.00%> (-19.48%)` | :arrow_down: |
| [pkg/source/reconciler/source/kafkasource.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL3NvdXJjZS9yZWNvbmNpbGVyL3NvdXJjZS9rYWZrYXNvdXJjZS5nbw==) | `0.00% <0.00%> (ø)` | |
| [pkg/source/mtadapter/adapter.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL3NvdXJjZS9tdGFkYXB0ZXIvYWRhcHRlci5nbw==) | `47.82% <22.72%> (-27.36%)` | :arrow_down: |
| [pkg/apis/sources/v1beta1/kafka\_lifecycle.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL2FwaXMvc291cmNlcy92MWJldGExL2thZmthX2xpZmVjeWNsZS5nbw==) | `53.33% <50.00%> (-0.52%)` | :arrow_down: |
| [pkg/channel/consolidated/utils/util.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL2NoYW5uZWwvY29uc29saWRhdGVkL3V0aWxzL3V0aWwuZ28=) | `95.91% <50.00%> (-4.09%)` | :arrow_down: |
| [pkg/source/client/offsets.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL3NvdXJjZS9jbGllbnQvb2Zmc2V0cy5nbw==) | `60.00% <60.00%> (ø)` | |
| [pkg/channel/consolidated/dispatcher/dispatcher.go](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox#diff-cGtnL2NoYW5uZWwvY29uc29saWRhdGVkL2Rpc3BhdGNoZXIvZGlzcGF0Y2hlci5nbw==) | `61.58% <66.66%> (+0.10%)` | :arrow_up: |
| ... and [33 more](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753?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/753?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=knative-sandbox). Last update [f6cdc01...04f3918](https://codecov.io/gh/knative-sandbox/eventing-kafka/pull/753?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-metrics-robot: The following is the coverage report on the affected files.
Say `/test pull-knative-sandbox-eventing-kafka-go-coverage` to re-run this coverage report

File | Old Coverage | New Coverage | Delta
---- |:------------:|:------------:|:-----:
[pkg/channel/webhook/controller.go](https://storage.cloud.google.com/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka/753/pull-knative-sandbox-eventing-kafka-go-coverage/1412439705538007040/artifacts/line-cov.html#file0) | Do not exist | 22.2% | 

knative-prow-robot: @travis-minke-sap: The following test **failed**, say `/retest` to rerun all failed tests:

Test name | Commit | Details | Rerun command
--- | --- | --- | ---
pull-knative-sandbox-eventing-kafka-go-coverage | d8f0240f8283796a8f774935e5c50b170572b679 | [link](https://prow.knative.dev/view/gs/knative-prow/pr-logs/pull/knative-sandbox_eventing-kafka/753/pull-knative-sandbox-eventing-kafka-go-coverage/1412439705538007040) | `/test pull-knative-sandbox-eventing-kafka-go-coverage`

[Full PR test history](https://gubernator.knative.dev/pr/knative-sandbox_eventing-kafka/753). [Your PR dashboard](https://gubernator.knative.dev/pr/travis-minke-sap).

<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 -->
eric-sap: /lgtm

Patch:
diff --git a/.github/workflows/knative-stale.yaml b/.github/workflows/knative-stale.yaml
index 972826971..899890a35 100644
--- a/.github/workflows/knative-stale.yaml
+++ b/.github/workflows/knative-stale.yaml
@@ -35,7 +35,7 @@ jobs:
           inactivity. Reopen the issue with `/reopen`. Mark the issue as
           fresh by adding the comment `/remove-lifecycle stale`.
         stale-issue-label: 'lifecycle/stale'
-        exempt-issue-labels: 'lifecycle/frozen'
+        exempt-issue-labels: 'lifecycle/frozen,triage/accepted'
 
         stale-pr-message: |-
           This Pull Request is stale because it has been open for 90 days with
diff --git a/cmd/webhook/main.go b/cmd/webhook/main.go
index 6af200566..1cc3c7167 100644
--- a/cmd/webhook/main.go
+++ b/cmd/webhook/main.go
@@ -16,11 +16,15 @@ limitations under the License.
 package main
 
 import (
-	channelwebhook "knative.dev/eventing-kafka/pkg/channel/webhook"
+	"os"
+	"strings"
+
 	"knative.dev/pkg/injection/sharedmain"
 	"knative.dev/pkg/signals"
 	"knative.dev/pkg/webhook"
 	"knative.dev/pkg/webhook/certificates"
+
+	channelwebhook "knative.dev/eventing-kafka/pkg/channel/webhook"
 )
 
 const (
@@ -30,6 +34,11 @@ const (
 
 func main() {
 
+	// Optionally Enable Support For ResetOffset
+	if strings.ToLower(os.Getenv("RESETOFFSET_SUPPORT")) == "true" {
+		channelwebhook.IncludeResetOffset()
+	}
+
 	// Define Webhook Options
 	options := webhook.Options{
 		ServiceName: webhook.NameFromEnv(),
diff --git a/config/channel/webhook/README.md b/config/channel/webhook/README.md
index 4ffcdadf5..c001d2d0d 100644
--- a/config/channel/webhook/README.md
+++ b/config/channel/webhook/README.md
@@ -1,3 +1,13 @@
 # KafkaChannel Webhook Config
 
 This Webhook configuration is shared by both KafkaChannel implementations.
+
+**Notes:**
+
+- The `webhook-deployment-ro.yaml` is a copy of `webhook-deployment.yaml`, with
+  an additional Environment Variable specifying support for ResetOffsets. It is
+  expected users of the webhook will link one or the other of the two
+  deployments. Once both KafkaChannel implementations have enabled the
+  ResetOffset Controller, we can again consolidate the two copies and remove the
+  Environment Variable and decision logic in `webhook/main.go`.
+
diff --git a/config/channel/webhook/webhook-clusterrole.yaml b/config/channel/webhook/webhook-clusterrole.yaml
index 2c7397fcf..9353c2c43 100644
--- a/config/channel/webhook/webhook-clusterrole.yaml
+++ b/config/channel/webhook/webhook-clusterrole.yaml
@@ -98,6 +98,17 @@ rules:
       - "list"
       - "watch"
 
+  # Support ResetOffset If Enabled
+  - apiGroups:
+      - "kafka.eventing.knative.dev"
+    resources:
+      - "resetoffsets"
+      - "resetoffsets/status"
+    verbs:
+      - "get"
+      - "list"
+      - "watch"
+
   # For leader election
   - apiGroups:
       - "coordination.k8s.io"
diff --git a/config/channel/webhook/webhook-deployment-ro.yaml b/config/channel/webhook/webhook-deployment-ro.yaml
new file mode 100644
index 000000000..d51759bd1
--- /dev/null
+++ b/config/channel/webhook/webhook-deployment-ro.yaml
@@ -0,0 +1,82 @@
+# Copyright 2020 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
+#
+#     https://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.
+
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: kafka-webhook
+  namespace: knative-eventing
+  labels:
+    kafka.eventing.knative.dev/release: devel
+spec:
+  replicas: 1
+  selector:
+    matchLabels: &labels
+      app: kafka-webhook
+      role: kafka-webhook
+  template:
+    metadata:
+      annotations:
+        sidecar.istio.io/inject: "false"
+      labels: *labels
+    spec:
+      serviceAccountName: kafka-webhook
+      containers:
+      - name: kafka-webhook
+        terminationMessagePolicy: FallbackToLogsOnError
+        image: ko://knative.dev/eventing-kafka/cmd/webhook
+        env:
+        - name: SYSTEM_NAMESPACE
+          valueFrom:
+            fieldRef:
+              fieldPath: metadata.namespace
+        - name: CONFIG_LOGGING_NAME
+          value: config-logging
+        - name: METRICS_DOMAIN
+          value: knative.dev/eventing
+        - name: WEBHOOK_NAME
+          value: kafka-webhook
+        - name: WEBHOOK_PORT
+          value: "8443"
+        - name: RESETOFFSET_SUPPORT
+          value: "true"
+        ports:
+        - name: https-webhook
+          containerPort: 8443
+        - name: metrics
+          containerPort: 9090
+        - name: profiling
+          containerPort: 8008
+        resources:
+          requests:
+            cpu: 100m
+            memory: 50Mi
+          limits:
+            cpu: 200m
+            memory: 1024Mi
+        readinessProbe: &probe
+          periodSeconds: 1
+          httpGet:
+            scheme: HTTPS
+            port: 8443
+            httpHeaders:
+            - name: k-kubelet-probe
+              value: "webhook"
+        livenessProbe:
+          <<: *probe
+          initialDelaySeconds: 20
+
+      # Our webhook should gracefully terminate by lame ducking first, set this to a sufficiently
+      # high value that we respect whatever value it has configured for the lame duck grace period.
+      terminationGracePeriodSeconds: 300
diff --git a/pkg/channel/webhook/controller.go b/pkg/channel/webhook/controller.go
index 3985e697f..f4ad561d1 100644
--- a/pkg/channel/webhook/controller.go
+++ b/pkg/channel/webhook/controller.go
@@ -20,14 +20,16 @@ import (
 	"context"
 
 	"k8s.io/apimachinery/pkg/runtime/schema"
-	"knative.dev/eventing-kafka/pkg/apis/messaging"
-	messagingv1beta1 "knative.dev/eventing-kafka/pkg/apis/messaging/v1beta1"
 	"knative.dev/pkg/configmap"
 	"knative.dev/pkg/controller"
 	"knative.dev/pkg/webhook/resourcesemantics"
 	"knative.dev/pkg/webhook/resourcesemantics/conversion"
 	"knative.dev/pkg/webhook/resourcesemantics/defaulting"
 	"knative.dev/pkg/webhook/resourcesemantics/validation"
+
+	kafkav1alpha1 "knative.dev/eventing-kafka/pkg/apis/kafka/v1alpha1"
+	"knative.dev/eventing-kafka/pkg/apis/messaging"
+	messagingv1beta1 "knative.dev/eventing-kafka/pkg/apis/messaging/v1beta1"
 )
 
 var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
@@ -37,6 +39,14 @@ var types = map[schema.GroupVersionKind]resourcesemantics.GenericCRD{
 
 var callbacks = map[schema.GroupVersionKind]validation.Callback{}
 
+// IncludeResetOffset adds the ResetOffset GVK entry to the Types map so that the WebHook will
+// support both CRDs for Defaulting and Validation Admission (but not Conversion).  This needs
+// to be called prior to calling the "NewXXXAdmissionController()" functions to have any effect.
+func IncludeResetOffset() {
+	gvkKey := kafkav1alpha1.SchemeGroupVersion.WithKind("ResetOffset")
+	types[gvkKey] = &kafkav1alpha1.ResetOffset{}
+}
+
 func NewDefaultingAdmissionController(ctx context.Context, _ configmap.Watcher) *controller.Impl {
 	return defaulting.NewAdmissionController(ctx,
 		// Name of the resource webhook.


Test patch:
diff --git a/.github/workflows/knative-go-test.yaml b/.github/workflows/knative-go-test.yaml
index 6abb34c2c..75b2a6591 100644
--- a/.github/workflows/knative-go-test.yaml
+++ b/.github/workflows/knative-go-test.yaml
@@ -50,6 +50,7 @@ jobs:
           fetch-depth: 0
 
       - name: Merge upstream
+        if: github.event_name == 'pull_request'
         run: |
           git remote add upstream https://github.com/${{ github.repository }}.git
           git fetch upstream ${{ github.base_ref }}
diff --git a/pkg/channel/webhook/controller_test.go b/pkg/channel/webhook/controller_test.go
new file mode 100644
index 000000000..a59179446
--- /dev/null
+++ b/pkg/channel/webhook/controller_test.go
@@ -0,0 +1,49 @@
+/*
+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 webhook
+
+import (
+	"testing"
+
+	"github.com/stretchr/testify/assert"
+	kafkav1alpha1 "knative.dev/eventing-kafka/pkg/apis/kafka/v1alpha1"
+	messagingv1beta1 "knative.dev/eventing-kafka/pkg/apis/messaging/v1beta1"
+)
+
+func TestDefaultTypeMap(t *testing.T) {
+	assert.Len(t, types, 1)
+	typeEntry := types[messagingv1beta1.SchemeGroupVersion.WithKind("KafkaChannel")]
+	assert.NotNil(t, typeEntry)
+	assert.IsType(t, &messagingv1beta1.KafkaChannel{}, typeEntry)
+}
+
+func TestDefaultCallbacksMap(t *testing.T) {
+	assert.Len(t, callbacks, 0)
+}
+
+func TestIncludeResetOffset(t *testing.T) {
+	IncludeResetOffset()
+	assert.Len(t, types, 2)
+
+	kcTypeEntry := types[messagingv1beta1.SchemeGroupVersion.WithKind("KafkaChannel")]
+	assert.NotNil(t, kcTypeEntry)
+	assert.IsType(t, &messagingv1beta1.KafkaChannel{}, kcTypeEntry)
+
+	roTypeEntry := types[kafkav1alpha1.SchemeGroupVersion.WithKind("ResetOffset")]
+	assert.NotNil(t, roTypeEntry)
+	assert.IsType(t, &kafkav1alpha1.ResetOffset{}, roTypeEntry)
+}