Bug 1705753 - Missing openapi CRD definitions for oc explain to work for sample operator CRD
Summary: Missing openapi CRD definitions for oc explain to work for sample operator CRD
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Templates
Version: 4.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 4.2.0
Assignee: Gabe Montero
QA Contact: XiuJuan Wang
URL:
Whiteboard:
: 1708600 (view as bug list)
Depends On: 1705752 1714775
Blocks: 1734402 1743376
TreeView+ depends on / blocked
 
Reported: 2019-05-02 21:15 UTC by Ben Parees
Modified: 2019-10-16 06:28 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: The CRD for the samples operator config object (configs.samples.operator.openshift.io) did not have openAPIV3Schema validation defined Consequence: `oc explain` was unable to provide useful information about the samples operator config object Fix: necessary auto-generation code to construct the openAPIV3Schema validation was introduced into the cluster operator make process Result: `oc explain` no works on the samples operator config object (configs.samples.operator.openshift.io)
Clone Of: 1705752
: 1743376 (view as bug list)
Environment:
Last Closed: 2019-10-16 06:28:30 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2019:2922 None None None 2019-10-16 06:28:47 UTC

Description Ben Parees 2019-05-02 21:15:33 UTC
+++ This bug was initially created as a clone of Bug #1705752 +++

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. 

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-version-operator/pull/168 and then update origin's e2e test and uncomment the lines from your components.

--- Additional comment from Maciej Szulik on 2019-05-02 21:10:49 UTC ---

Adam, I couldn't figure out a component for cluster-samples-operator but I've created just one issue wrt to imageregistry and sample operator configs. 
I'd like to see both addressed.

Comment 1 Ben Parees 2019-05-02 21:16:08 UTC
Created this clone to address the samples-operator aspect of Maciej's comment above.

Comment 2 Gabe Montero 2019-05-02 23:26:30 UTC
so I see this targeted at 4.1.0, but the priority/severity are unspecified 

should I assume this has to get into 4.1.0 GA ?

Comment 3 Ben Parees 2019-05-02 23:59:19 UTC
unless Maciej says otherwise, yes.  You can ask him what the importance is since he originated them.

Comment 4 Adam Kaplan 2019-05-03 16:55:13 UTC
@Maciej this is a bit of a riskier proposition, since adding library-go requires bumping k8s.io deps to 1.13. Can we address this as tech debt in 4.2 (with a potential z-stream update for 4.1)?

Comment 5 Gabe Montero 2019-05-03 18:25:25 UTC
fyi https://github.com/openshift/cluster-openshift-controller-manager-operator appears to implement the crd codegen defs and is glide based

Comment 6 Gabe Montero 2019-05-03 19:36:41 UTC
In addition to the 1.13 bump, samples operator is going to have to be added to openshift/api a la https://github.com/openshift/api/pull/183
in order for 

	go run ./vendor/github.com/openshift/library-go/cmd/crd-schema-gen/main.go --domain openshift.io --apis-dir vendor/github.com/openshift/api --manifests-dir manifests/


to work.

Without that update, I get 

  Config.samples.operator.openshift.io
no API type for found CRD manifests
exit status 1

Comment 7 Gabe Montero 2019-05-03 19:39:21 UTC
Paul just told me that Maciej says z-stream is fine

Comment 8 Gabe Montero 2019-05-03 20:17:02 UTC
sorted out with some Ben assistance the following to bypass openshift/api updates:

	go run ./vendor/github.com/openshift/library-go/cmd/crd-schema-gen/main.go --domain operator.openshift.io --apis-dir pkg/apis --manifests-dir manifests/

Comment 9 Maciej Szulik 2019-05-03 20:18:37 UTC
Yeah, that should work. The main gist is just the crd-schema-gen call. 4.1.x is perfect to land this.

Comment 10 Gabe Montero 2019-05-03 21:01:21 UTC
Thanks Maciej

PR https://github.com/openshift/cluster-samples-operator/pull/144 is up for review and regression testing 
while we wait for 4.1.x to open up.

Comment 11 Paul Weil 2019-05-10 12:07:50 UTC
*** Bug 1708600 has been marked as a duplicate of this bug. ***

Comment 12 Ben Parees 2019-05-13 13:58:10 UTC
moving to 4.2.0, if you decide to backport it to 4.1.z create a clone.

Comment 13 Gabe Montero 2019-05-16 19:56:57 UTC
master branch / 4.2.0 PR has merged 

moving to ON_QA to await build

Comment 14 Gabe Montero 2019-05-17 11:43:57 UTC
Turns out 4.2 builds are not ready yet on the OSBS/brew side.  I'm in contact with the ART to track when they become available.

Moving to Modified

Comment 15 Gabe Montero 2019-05-23 18:57:31 UTC
After running `oc explain` with the changes from https://github.com/openshift/cluster-samples-operator/pull/144 I'm going to update some godoc
and clean up a few things, enhance a few things.

New PR coming

Moving back to ASSIGNED until new PR comes up.

Also, I think there is enough there though to re-enable the test in openshift/origin/test/extended/cli/explain.go

Comment 16 Gabe Montero 2019-05-23 20:27:51 UTC
PR https://github.com/openshift/cluster-samples-operator/pull/148 is up

FYI ... run oc explain configs --api-version=samples.operator.openshift.io/v1 to see spec/status updates

Comment 17 Gabe Montero 2019-05-23 20:55:03 UTC
Also, https://github.com/openshift/origin/pull/22899 re-enables samples operator in the extended test Maciej referenced in the description

Comment 18 Gabe Montero 2019-05-23 22:04:32 UTC
PR has merged

Comment 19 XiuJuan Wang 2019-05-24 03:40:26 UTC
Check with 4.2.0-0.ci-2019-05-23-230227 

The DESCRIPTION part is empty, and inconsistent space between apiVersion, metadata

$ oc explain configs --api-version=samples.operator.openshift.io/v1 
KIND:     Config
VERSION:  samples.operator.openshift.io/v1

DESCRIPTION:
     <empty>

FIELDS:
   apiVersion	<string>
     APIVersion defines the versioned schema of this representation of an
     object. Servers should convert recognized schemas to the latest internal
     value, and may reject unrecognized values. More info:
     https://git.k8s.io/community/contributors/devel/api-conventions.md#resources

   kind	<string>
     Kind is a string value representing the REST resource this object
     represents. Servers may infer this from the endpoint the client submits
     requests to. Cannot be updated. In CamelCase. More info:
     https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds

   metadata	<Object>
     Standard object's metadata. More info:
     https://git.k8s.io/community/contributors/devel/api-conventions.md#metadata

   spec	<Object>
     Spec contains the desired configuration and state for the Samples Operator,
     controlling various behavior around the imagestreams and templates it
     creates/updates in the openshift namespace.

   status	<Object>
     Status contains the actual configuration in effect, as well as various
     details that describe the state of the Samples Operator.

Comment 20 Gabe Montero 2019-05-24 14:23:44 UTC
Those are generic `oc explain` items, not anything to do with the changes around this bug.

You'll see the same thing if you run `oc explain` against the other CRDs.  That is what I saw
when I tested this.

Open a bug against the CLI component if you want those addressed.

The spec/status you noted above is valid verification of this bug.

Comment 21 XiuJuan Wang 2019-05-27 02:03:12 UTC
Gabe,
Thanks~
Move to verified as comment #20

Comment 22 errata-xmlrpc 2019-10-16 06:28:30 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-2019:2922


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