Bug 1733178

Summary: 3rd party operator schema should be loaded correctly
Product: OpenShift Container Platform Reporter: Yadan Pei <yapei>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED NOTABUG QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.2.0CC: aos-bugs, jokerman, mmccomas, yapei
Target Milestone: ---   
Target Release: 4.2.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: 2019-07-26 22:25:15 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:

Description Yadan Pei 2019-07-25 10:37:25 UTC
Description of problem:
when user tries to edit YAML for CRDs third party operator defines, no schema is  loaded

Version-Release number of selected component (if applicable):
4.2.0-0.nightly-2019-07-24-220922

How reproducible:
Always

Steps to Reproduce:
1. Cluster admin user subscribe 3rd party operators, like Metering, Knative Serving, after operator is installed successfully, create some CRs the operator defines, Metering or KnativeServing
2. Cluster admin user goes to Search -> Metering -> click `Operator Metering` and goes to its YAML tab > then click 'View Schema'


Actual results:
2. It shows "No Properties Found"

Expected results:
2. We should load and show the schema for CRD meterings.metering.openshift.io 

Additional info:

Comment 1 Samuel Padgett 2019-07-26 22:25:15 UTC
We can only show schemas for CRDs that have specified a structural schema in their definition. Without this, the resource is not in the OpenAPI document, and console doesn't have the data to show. If `oc explain` does not work properly for the resource, it will not have a schema in console.

https://kubernetes.io/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#specifying-a-structural-schema

Comment 2 Yadan Pei 2019-07-29 05:51:13 UTC
Ok, thanks for the explanation