Bug 1889529 - [Init-CR annotation] Inline alert shows operand instance was needed still appearing after creating an Operand instance
Summary: [Init-CR annotation] Inline alert shows operand instance was needed still app...
Keywords:
Status: VERIFIED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.7.0
Assignee: Zac Herman
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-10-19 21:45 UTC by tony.wu
Modified: 2020-11-03 08:39 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)
1_StorageCluster_creating.png (305.61 KB, image/png)
2020-10-19 21:45 UTC, tony.wu
no flags Details
2_Operator-details_page_still_shows_StorageCluster_CR_is_required_and_to-be-created.png (405.13 KB, image/png)
2020-10-19 21:46 UTC, tony.wu
no flags Details
UX design showing inline alert when operand fails to be created (610.63 KB, image/png)
2020-10-20 17:07 UTC, Peter Kreuser
no flags Details
portworx init-CR: StorageCluster template without metadata.namespace (190.61 KB, image/png)
2020-10-27 00:33 UTC, tony.wu
no flags Details

Description tony.wu 2020-10-19 21:45:59 UTC
Created attachment 1722728 [details]
1_StorageCluster_creating.png

Description of problem:
It's noticed the inline alert mentioning that an operand instance was needed was still appearing after creating an instance of that operand in the installing flow. 


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


How reproducible:
100% with OCS Operator (in a custom CatalogSource, see details below)


Steps to Reproduce:
1. Install a custom CatalogSource with OCS Operator included "init-CR" annotation.
--
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: tonywu-catsrc
  namespace: openshift-marketplace
spec:
  displayName: TW's CatalogSource
  sourceType: grpc
  image: quay.io/tlwu2013/tw-index:latest
 

2. Go to "OperatorHub" page and install OCS Operator from "TW's CatalogSource" Provider Type

3. Wait until Operator installed succeeded, click the button to create "StorageCluster" CR

4. Go to "Installed Operators" page, and click "OCS Operator" to go to Operator details page


Actual results:
The inline alert mentioning that an operand instance was needed was still appearing after creating an instance of that operand in the installing flow. 


Expected results:
The inline alert mentioning that an operand instance was needed should be dismissed after creating an instance of that operand.


Additional info:
See screenshots in the attachment for reference.

Comment 1 tony.wu 2020-10-19 21:46:37 UTC
Created attachment 1722729 [details]
2_Operator-details_page_still_shows_StorageCluster_CR_is_required_and_to-be-created.png

Comment 2 Peter Kreuser 2020-10-20 17:07:07 UTC
In the case that the operand fails to be created for some reason, it would be good if we could also alert the user using the same inline alert paradigm, but with the error styling.

Shown in image 3_operand_failed

Also of note is that the inline alert appears above the tabs (instead of in Details) which would be preferred for both the warning and this error so it's always visible, vs today it is located in the Details tab.

Comment 3 Peter Kreuser 2020-10-20 17:07:42 UTC
Created attachment 1722934 [details]
UX design showing inline alert when operand fails to be created

Comment 4 Zac Herman 2020-10-22 15:33:57 UTC
Won't work on this until next week which will be next sprint.

Comment 5 Zac Herman 2020-10-26 23:59:29 UTC
Ok, so this works fine with the Portworx operator with CR.  It does not work with the OCS CR example because the initialization-resource (from the annotation) has no namespace defined and we need the namespace to determine where to look for the resource. 
"operatorframework.io/initialization-resource": "\n{\n    \"apiVersion\": \"ocs.openshift.io/v1\",\n    \"kind\": \"StorageCluster\",\n    \"metadata\": {\n        \"name\": \"example-storagecluster\"\n    },\n    \"spec\": {\n        \"manageNodes\": false,\n        \"monPVCTemplate\": {\n            \"spec\": {\n                \"accessModes\": [\n                    \"ReadWriteOnce\"\n                ],\n                \"resources\": {\n                    \"requests\": {\n                        \"storage\": \"10Gi\"\n                    }\n                },\n                \"storageClassName\": \"gp2\"\n            }\n        },\n        \"storageDeviceSets\": [\n            {\n                \"count\": 3,\n                \"d

The namespace is defined in the alm-example, but that is not what we decided to trigger all this logic off of originally.
"alm-examples": "\n[\n    {\n        \"apiVersion\": \"ocs.openshift.io/v1\",\n        \"kind\": \"StorageCluster\",\n        \"metadata\": {\n            \"name\": \"example-storagecluster\",\n            \"namespace\": \"openshift-storage\"\n        },\n        \"spec\": {\n   

So this is working as designed.  We agreed that the namespace would come from the initialization-resource because that is what defines that we need this CR in the first place (having the initialization-resource in the annotation is what triggers the alert).  So, I suggest the OCS operator is wrong.  @tony.wu@redhat.com

Comment 6 tony.wu 2020-10-27 00:08:40 UTC
The Portworx's init-CR template doesn't include `metadata.namespace` either and that field has never been agreed as a "required" field.

Hence your reasoning for the cause of this bug is invalid.

Comment 7 tony.wu 2020-10-27 00:33:40 UTC
Created attachment 1724428 [details]
portworx init-CR: StorageCluster template without metadata.namespace

Comment 9 Yadan Pei 2020-11-03 08:39:54 UTC
Verification steps

1. Install a custom CatalogSource with OCS Operator included "init-CR" annotation.
--
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: tonywu-catsrc
  namespace: openshift-marketplace
spec:
  displayName: TW's CatalogSource
  sourceType: grpc
  image: quay.io/tlwu2013/tw-index:latest
 

2. Go to "OperatorHub" page and install `OpenShift Container Storage` Operator from "TW's CatalogSource" Provider Type

3. Wait until Operator installed succeeded, click the button 'Create StorageCluster' to create "StorageCluster" CR, wait until "StorageCluster" CR is created

4. Go to "Installed Operators" page, and click "OpenShift Container Storage Operator" to go to Operator details page, the inline alert mentioning that an operand instance was needed isn't shown any more

Verified on 4.7.0-0.ci-2020-11-03-041130


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