Bug 2083641

Summary: OpenShift Console Knative Eventing ContainerSource generates wrong api version when pointed to k8s Service
Product: OpenShift Container Platform Reporter: bshaw <bshaw>
Component: Dev ConsoleAssignee: Jaivardhan Kumar <jakumar>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: high Docs Contact:
Priority: high    
Version: 4.10CC: cjerolim, nmukherj
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 11:11:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 2084430    

Description bshaw 2022-05-10 13:58:59 UTC
Description of problem:

In OpenShift 4.10, Kubernetes Services are [valid sink resources during Event Source creation](https://developers.redhat.com/articles/2022/03/22/whats-new-developers-openshift-410-console#openshift_4_10_serverless_and_eventing_features) - however, the generated `ContainerSource` resource sets `.spec.apiVersion` to `core/v1` instead of `v1`.

This results in the `SinkBinding` failing to generate the URI to the sink.



How reproducible:
Yes

Steps to Reproduce:
1. Install OpenShift Serverless on OpenShift 4.10.11 (RHPDS OpenShift 4.10 Workshop) and setup Knative Serving and Knative Eventing

2. Create a `Deployment` and `Service` that listens for CloudEvents - 

3. In the OpenShift console,
  a. Select Add / Eventing / EventSource / ContainerSource / Create Event Source
  b. Set the Image field to something that sends CloudEvents - I used `ghcr.io/kwkoo/fast-ping`
  c. Set the Input Target field to Resource and point it to the `event-display-deploy` Service
  d. Click Create

4. When you look at the generated `SinkBinding`, you get:

```
...
spec:
  sink:
    ref:
      apiVersion: core/v1
      kind: Service
      name: event-display-deploy
      namespace: demo
  subject:
    apiVersion: apps/v1
    kind: Deployment
    name: fast-ping-deployment
    namespace: demo
status:
  conditions:
    - lastTransitionTime: '2022-05-06T05:24:28Z'
      message: 'URI could not be extracted from destination '
      reason: NoURI
      status: 'False'
      type: Ready
```

5. It only works if you change `.spec.sink.ref.apiVersion` in the `ContainerSource` to `v1`

Comment 1 Christoph Jerolimov 2022-05-10 19:18:46 UTC
(Trigger Jira sync)

Comment 5 spathak@redhat.com 2022-05-24 15:13:30 UTC
Verified on build version: 4.11.0-0.nightly-2022-05-20-213928
browser version: Chrome 99

Comment 7 errata-xmlrpc 2022-08-10 11:11:01 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:5069