Bug 2002266

Summary: SinkBinding create form doesn't allow to use subject name, instead of label selector
Product: OpenShift Container Platform Reporter: Chris Suszynski <ksuszyns>
Component: Dev ConsoleAssignee: Mohammed Saud <msaud>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: high Docs Contact:
Priority: medium    
Version: 4.6CC: aos-bugs, cjerolim, dsantra, jakumar, msaud, nmukherj, sbudhwar
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
* Before this update, you could only specify a subject in the `SinkBinding` form by label, not by name. With this update, you can use a drop-down list to select whether to specify a subject by name or label. (link:https://bugzilla.redhat.com/show_bug.cgi?id=2002266[BZ#2002266])
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-10 16:08:32 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: 2027269    

Description Chris Suszynski 2021-09-08 11:31:03 UTC
Description of problem:

The current UI for Serverless SinkBinding doesn't allow the user to specify a subject name. The end-user is forced to use a label selector-based method, but the resource he likes to target might not have any.

Version-Release number of selected component (if applicable): any


How reproducible: always


Steps to Reproduce:
1. In the Developer perspective, navigate to +Add → Event Source.
2. Select Sink Binding and then click Create Event Source. The Create Event Source page is displayed.

Actual results:

There is no option to choose a name-based subject selection instead of label-based one.


Expected results:

The form should allow to choose either a name-based or label-based resource selection. If name-based one is chosen, the match label section should be removed. If the label-based method is chosen, the name field should be removed.


Additional info:

This is valid for every OCP version

Comment 1 Jaivardhan Kumar 2021-09-14 06:24:47 UTC
Hi Chris, can you pls provide an example/scenario for name-based or label-based resource selection and this will only be for sinkBinding form right?

Comment 2 Chris Suszynski 2021-09-15 19:55:03 UTC
Sure. This page gives an example of creating Sink Binding subject: https://knative.dev/docs/developer/eventing/sources/sinkbinding/getting-started/#create-a-subject

There you can see that it supports:

 * Deployment
 * Job
 * DaemonSet
 * StatefulSet
 * Service.serving.knative.dev

All of them could be referenced by name instead of label selector. Name-based selection is far easier, I just deploy my knative service, and the use it as a subject, for example using `kn`:

```
$ kn source binding create bind-br-default \
    --subject Service:serving.knative.dev/v1:showcase \
    --sink broker:default \
    --ce-override sink=bound
```

Label based is only required when using CronJob, as we are, in fact, targeting Job's created by CronJob, and their names contain random strings.

And yes, this applies only to Sink Binding, as we are talking on subject field, which is present only in Sink binding type.

Comment 4 Christoph Jerolimov 2021-12-06 10:22:17 UTC
Hey Chris, can you verify this changes (https://github.com/openshift/console/pull/10527), if this matches your requirements, and mark this issue as verified when you have tested this on a cluster?

Comment 6 Chris Suszynski 2021-12-17 11:20:05 UTC
I did try to verify this. I've deployed the OCP 4.10.0-0.nightly-2021-12-14-083101 version, but this fix wasn't there.

Comment 7 Debsmita Santra 2021-12-17 17:39:11 UTC
verified this on 4.10.0-0.ci-2021-12-16-184808

Comment 9 Chris Suszynski 2021-12-20 16:02:25 UTC
Confirmed, it works.

Comment 14 errata-xmlrpc 2022-03-10 16:08:32 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 (Moderate: OpenShift Container Platform 4.10.3 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:0056