Description of problem: Need a new end point in console that specifically returns the metadata for all duck typed Knative event source CRDs. This shall allow an unprivileged user to get this information without read access to CRDs. Version-Release number of selected component (if applicable): 4.5 How reproducible: Prerequisites: Install 'OpenShift Serverless Operator' & 'Knative Eventing Operator' Steps to Reproduce: 1. Fire following API using curl/REST client/browser https://<openshift host name>/api/console/knative-event-sources 2. Try logging with Admin as well as basic user credentials Actual results: API returns 404 as it's not implemented. Expected results: API shall return all duck typed Knative event sources Additional info: Even if operators mentioned in prerequisite are not installed, API shall return empty list of 'items'
@Abhishek, I'm not sure the steps to verified the bug, we should install Knative Eventing Operator first, right? I tried to install it in project, but failed. Failed CustomResourceDefinition.apiextensions.k8s.io "knativeeventings.eventing.knative.dev" is invalid: spec.validation.openAPIV3Schema.type: Required value: must not be empty at the root
@yanpzhan I've updated the description with additional details. Operator installation failure might be due to issue https://bugzilla.redhat.com/show_bug.cgi?id=1825330. Since PR related to this issue is merged we don't observe any issue with operator installation on latest CI builds.
Checked on ocp 4.5 cluster with payload: 4.5.0-0.nightly-2020-04-29-223453. 1. When 'OpenShift Serverless Operator' and 'Knative Eventing Operator' are not install, with Admin as well as basic user credentials, access from browser: https://<openshift host name>/api/console/knative-event-sources, it returns items with empty context: {"kind":"CustomResourceDefinitionList","apiVersion":"apiextensions.k8s.io/v1","metadata":{"selfLink":"/apis/apiextensions.k8s.io/v1/customresourcedefinitions","resourceVersion":"73794"},"items":[]} 2. After 'OpenShift Serverless Operator' and 'Knative Eventing Operator' are installed, with Admin as well as basic user credentials, access from browser: https://<openshift host name>/api/console/knative-event-sources, it returns items: {"kind":"CustomResourceDefinitionList","apiVersion":"apiextensions.k8s.io/v1","metadata":{"selfLink":"/apis/apiextensions.k8s.io/v1/customresourcedefinitions","resourceVersion":"223955"},"items":[{"metadata":{"name":"apiserversources.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"apiserversources","singular":"apiserversource","kind":"ApiServerSource","listKind":"ApiServerSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"apiserversources.sources.knative.dev"},"spec":{"group":"sources.knative.dev","names":{"plural":"apiserversources","singular":"apiserversource","kind":"ApiServerSource","listKind":"ApiServerSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true},{"name":"v1alpha2","served":false,"storage":false}]}},{"metadata":{"name":"containersources.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"containersources","singular":"containersource","kind":"ContainerSource","listKind":"ContainerSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"cronjobsources.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"cronjobsources","singular":"cronjobsource","kind":"CronJobSource","listKind":"CronJobSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"pingsources.sources.knative.dev"},"spec":{"group":"sources.knative.dev","names":{"plural":"pingsources","singular":"pingsource","kind":"PingSource","listKind":"PingSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true},{"name":"v1alpha2","served":true,"storage":false}]}},{"metadata":{"name":"sinkbindings.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"sinkbindings","singular":"sinkbinding","kind":"SinkBinding","listKind":"SinkBindingList","categories":["all","knative","eventing","sources","bindings"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"sinkbindings.sources.knative.dev"},"spec":{"group":"sources.knative.dev","names":{"plural":"sinkbindings","singular":"sinkbinding","kind":"SinkBinding","listKind":"SinkBindingList","categories":["all","knative","eventing","sources","bindings"]},"versions":[{"name":"v1alpha1","served":true,"storage":true},{"name":"v1alpha2","served":true,"storage":false}]}}]} 3. (Operators are installed)Try curl the api, it return nothing. [root@MiWiFi-R1CM ~]# curl -k -H "Authorization: Bearer eAATrr-rM92wHGfobqrBOXucDCXVywhPwxL2KqNH6DE" https://console-openshift-console.apps.qe-groupd1-0430.qe.devcluster.openshift.com/api/console/knative-event-sources [root@MiWiFi-R1CM ~]# curl -k -H "Authorization: Bearer eAATrr-rM92wHGfobqrBOXucDCXVywhPwxL2KqNH6DE" https://console-openshift-console.apps.qe-groupd1-0430.qe.devcluster.openshift.com/api/console/version [root@MiWiFi-R1CM ~]# @Abhishek, thanks for you help info, from the above info, I think the api entry works from console. But curl from client get nothing, not only the /api/console/knative-event-sources, but also /api/console/version didn't return anything. Could you help to check if the client step is not correct?
@yanpzhan Try to add -v option to curl & you might see 401 Unauthorized error. If so the Bearer token used is incorrect. Try to use 'openshift-session-token' from browser & set it using -b option.
Tested again on 4.5 cluster with payload 4.5.0-0.nightly-2020-05-04-113741 Before 'OpenShift Serverless Operator' and 'Knative Eventing Operator' are installed: [zyp@MiWiFi-R1CM ~]$ curl -k -b "openshift-session-token=DzrhZSufNfA_tiNCM89rOXlL9aQ2TuIJ7eRRdefPB3w" https://console-openshift-console.apps.qe-groupd-0506.qe.devcluster.openshift.com/api/console/knative-event-sources {"kind":"CustomResourceDefinitionList","apiVersion":"apiextensions.k8s.io/v1","metadata":{"selfLink":"/apis/apiextensions.k8s.io/v1/customresourcedefinitions","resourceVersion":"109241"},"items":[]} After 'OpenShift Serverless Operator' and 'Knative Eventing Operator' are installed: [zyp@MiWiFi-R1CM ~]$ curl -k -b "openshift-session-token=DzrhZSufNfA_tiNCM89rOXlL9aQ2TuIJ7eRRdefPB3w" https://console-openshift-console.apps.uster.openshift.com/api/console/knative-event-sources {"kind":"CustomResourceDefinitionList","apiVersion":"apiextensions.k8s.io/v1","metadata":{"selfLink":"/apis/apiextensions.k8s.io/v1/customresourcedefinitions","resourceVersion":"155911"},"items":[{"metadata":{"name":"apiserversources.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"apiserversources","singular":"apiserversource","kind":"ApiServerSource","listKind":"ApiServerSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"apiserversources.sources.knative.dev"},"spec":{"group":"sources.knative.dev","names":{"plural":"apiserversources","singular":"apiserversource","kind":"ApiServerSource","listKind":"ApiServerSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true},{"name":"v1alpha2","served":false,"storage":false}]}},{"metadata":{"name":"containersources.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"containersources","singular":"containersource","kind":"ContainerSource","listKind":"ContainerSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"cronjobsources.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"cronjobsources","singular":"cronjobsource","kind":"CronJobSource","listKind":"CronJobSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"pingsources.sources.knative.dev"},"spec":{"group":"sources.knative.dev","names":{"plural":"pingsources","singular":"pingsource","kind":"PingSource","listKind":"PingSourceList","categories":["all","knative","eventing","sources"]},"versions":[{"name":"v1alpha1","served":true,"storage":true},{"name":"v1alpha2","served":true,"storage":false}]}},{"metadata":{"name":"sinkbindings.sources.eventing.knative.dev"},"spec":{"group":"sources.eventing.knative.dev","names":{"plural":"sinkbindings","singular":"sinkbinding","kind":"SinkBinding","listKind":"SinkBindingList","categories":["all","knative","eventing","sources","bindings"]},"versions":[{"name":"v1alpha1","served":true,"storage":true}]}},{"metadata":{"name":"sinkbindings.sources.knative.dev"},"spec":{"group":"sources.knative.dev","names":{"plural":"sinkbindings","singular":"sinkbinding","kind":"SinkBinding","listKind":"SinkBindingList","categories":["all","knative","eventing","sources","bindings"]},"versions":[{"name":"v1alpha1","served":true,"storage":true},{"name":"v1alpha2","served":true,"storage":false}]}}]} The bug is fixed, so move it to Verified. Thank @Abhishek for helping!
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, 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/RHBA-2020:2409