Bug 1862500 - YAML example uses alm-example but should use initialization resource if exist
Summary: YAML example uses alm-example but should use initialization resource if exist
Keywords:
Status: VERIFIED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.6.0
Assignee: Zac Herman
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-31 14:53 UTC by Zac Herman
Modified: 2020-09-11 02:34 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift console pull 6393 None closed Bug 1862500: Use initialization-resource annotation for yaml 2020-09-11 02:24:25 UTC

Description Zac Herman 2020-07-31 14:53:22 UTC
Description of problem:
The yaml example pafe shows the alm-example for CSV resources which is fine except when an initialization resource is present in the annotations.

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


How reproducible:
Always

Steps to Reproduce:
1. Go to Install Operator Details
2. Create resource with yaml editor
3.

Actual results:
Shows alm-example always

Expected results:
Should show initialization resource if it exists

Additional info:

Comment 2 Zac Herman 2020-08-20 20:29:56 UTC
Moved to upcoming sprint as review/QA has not happened.

Comment 5 Yadan Pei 2020-09-11 02:34:43 UTC
1. Create an operator CSV has operatorframework.io/initialization-resource annotation, and the example YAML is different in alm-examples and operatorframework.io/initialization-resource for the same resource, for example:

    operatorframework.io/initialization-resource: |
      {
        "apiVersion": "core.libopenstorage.org/v1alpha1",
        "kind": "StorageCluster",
        "metadata": {
          "name": "portworx",
          "annotations": {
            "portworx.io/is-openshift": "true",
            "autotest": "yes"
          }
        }
      }
    alm-examples: |-
      [
        {
          "apiVersion": "core.libopenstorage.org/v1alpha1",
          "kind": "StorageCluster",
          "metadata": {
            "name": "portworx",
            "namespace": "test-operator",
            "annotations": {
              "portworx.io/is-openshift": "true"
            }
          }
        },
        {
2. Install the operator and goes to create 'StroageCluster' resource
3. the YAML view shows yaml snippet operatorframework.io/initialization-resource has specified
      {
        "apiVersion": "core.libopenstorage.org/v1alpha1",
        "kind": "StorageCluster",
        "metadata": {
          "name": "portworx",
          "annotations": {
            "portworx.io/is-openshift": "true",
            "autotest": "yes"
          }
        }
      }

Verified on 4.6.0-0.nightly-2020-09-10-195619


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