Bug 1769003 - Missing openapi CRD definitions for oc explain to work
Summary: Missing openapi CRD definitions for oc explain to work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
: 4.4.0
Assignee: Alexander Greene
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks: 1780378
TreeView+ depends on / blocked
 
Reported: 2019-11-05 18:11 UTC by Maciej Szulik
Modified: 2020-05-04 11:15 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1780378 (view as bug list)
Environment:
Last Closed: 2020-05-04 11:14:43 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1157 'None' closed Bug 1769003: Implement Structural Schema for CRDs 2020-04-14 09:35:40 UTC
Red Hat Product Errata RHBA-2020:0581 None None None 2020-05-04 11:15:11 UTC

Description Maciej Szulik 2019-11-05 18:11:47 UTC
The following PR https://github.com/openshift/origin/pull/22696 introduced an e2e which is verifying that all the operators provide descriptive information as part of their schema which is then available through oc explain command. 
This was recently updated and brought back in https://github.com/openshift/origin/pull/24058. 

Your component has a few missing bits, see the commented out lines from the PR.

This should be fixed similarly to https://github.com/openshift/cluster-kube-controller-manager-operator/pull/302, 
iow. it should be using openshift/api's generated CRD yamls. 

Once done update origin's e2e test and uncomment the lines from your components.

Comment 1 Daniel Messer 2019-11-06 13:47:38 UTC
Thanks for the suggestion. OLM is an independent project as part of the Operator Framework, not Origin. We'll continue to use the Operator SDK to generate the CRDs and should have structural CRDs (as required in 1.16) soon.

Comment 5 Maciej Szulik 2020-01-30 09:54:06 UTC
The best option is the check the CRDs status, but the most important part is to have pruning enabled,
you do that setting 

preserveUnknownFields: false

like here: https://github.com/openshift/api/blob/master/operator/v1/0000_20_kube-apiserver-operator_01_config.crd.yaml#L11

this will enforce structural schema to start with. Now you'll need to ensure that the rest of your CRD 
follows it. It's best to create your CRD and check its status, if there will be problems you should see
that reflected in CRD's status.

Comment 7 Jian Zhang 2020-02-24 09:58:43 UTC
Cluster version is 4.4.0-0.nightly-2020-02-23-191320
mac:~ jianzhang$ oc exec catalog-operator-6f68c78746-lgfwf -- olm --version
OLM version: 0.14.2
git commit: 3d7f04faecb0072e72858b67af34232f854a17cc

Now, the apiVersion of the CRD is `v1`, the pruning enabled as default.
Check the CRD created by OLM:
mac:~ jianzhang$ oc get crd |grep operators.coreos.com 
catalogsourceconfigs.operators.coreos.com                   2020-02-24T03:28:28Z
catalogsources.operators.coreos.com                         2020-02-24T03:28:37Z
clusterserviceversions.operators.coreos.com                 2020-02-24T03:28:35Z
installplans.operators.coreos.com                           2020-02-24T03:28:36Z
operatorgroups.operators.coreos.com                         2020-02-24T03:28:38Z
operatorsources.operators.coreos.com                        2020-02-24T03:28:31Z
subscriptions.operators.coreos.com                          2020-02-24T03:28:37Z

Check the status of all of them, works well. LGTM, verify it.
mac:~ jianzhang$ for i in catalogsourceconfigs catalogsourceconfigs clusterserviceversions installplans operatorgroups operatorsources subscriptions; do oc get crd $i.operators.coreos.com -o=jsonpath='{.status}'; echo -e "\n"; done;
map[acceptedNames:map[kind:CatalogSourceConfig listKind:CatalogSourceConfigList plural:catalogsourceconfigs shortNames:[csc] singular:catalogsourceconfig] conditions:[map[lastTransitionTime:2020-02-24T03:28:28Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2020-02-24T03:28:28Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v2]]

map[acceptedNames:map[kind:CatalogSourceConfig listKind:CatalogSourceConfigList plural:catalogsourceconfigs shortNames:[csc] singular:catalogsourceconfig] conditions:[map[lastTransitionTime:2020-02-24T03:28:28Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2020-02-24T03:28:28Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v2]]

map[acceptedNames:map[categories:[olm] kind:ClusterServiceVersion listKind:ClusterServiceVersionList plural:clusterserviceversions shortNames:[csv csvs] singular:clusterserviceversion] conditions:[map[lastTransitionTime:2020-02-24T03:28:35Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2020-02-24T03:28:35Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v1alpha1]]

map[acceptedNames:map[categories:[olm] kind:InstallPlan listKind:InstallPlanList plural:installplans shortNames:[ip] singular:installplan] conditions:[map[lastTransitionTime:2020-02-24T03:28:36Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2020-02-24T03:28:36Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v1alpha1]]

map[acceptedNames:map[categories:[olm] kind:OperatorGroup listKind:OperatorGroupList plural:operatorgroups shortNames:[og] singular:operatorgroup] conditions:[map[lastTransitionTime:2020-02-24T03:28:38Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2020-02-24T03:28:38Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v1]]

map[acceptedNames:map[kind:OperatorSource listKind:OperatorSourceList plural:operatorsources shortNames:[opsrc] singular:operatorsource] conditions:[map[lastTransitionTime:2020-02-24T03:28:31Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2020-02-24T03:28:31Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v1]]

map[acceptedNames:map[categories:[olm] kind:Subscription listKind:SubscriptionList plural:subscriptions shortNames:[sub subs] singular:subscription] conditions:[map[lastTransitionTime:2020-02-24T03:28:37Z message:no conflicts found reason:NoConflicts status:True type:NamesAccepted] map[lastTransitionTime:2020-02-24T03:28:37Z message:the initial names have been accepted reason:InitialNamesAccepted status:True type:Established]] storedVersions:[v1alpha1]]

Comment 9 errata-xmlrpc 2020-05-04 11:14:43 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, 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:0581


Note You need to log in before you can comment on or make changes to this bug.