Bug 1835325

Summary: Runtime error on create operand form when almExamples annotation is not defined
Product: OpenShift Container Platform Reporter: Jon Jackson <jonjacks>
Component: Management ConsoleAssignee: Jon Jackson <jonjacks>
Status: CLOSED ERRATA QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.5CC: aos-bugs, hasha, jokerman, yapei
Target Milestone: ---   
Target Release: 4.4.z   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Cause: When almExamples annotation did not exist or was not valid JSON, we were not catching the exception that was thrown by JSON.parse Consequence: An uncaught runtime error would occur. Fix: Catch errors when attempting to parse almExamples annotation. Result: Errors related to parsing almExamples are now handled gracefully.
Story Points: ---
Clone Of: 1835324 Environment:
Last Closed: 2020-06-02 11:18:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1835324    
Bug Blocks:    
Attachments:
Description Flags
YAML to create mock operator none

Description Jon Jackson 2020-05-13 15:39:40 UTC
Created attachment 1688098 [details]
YAML to create mock operator

+++ This bug was initially created as a clone of Bug #1835324 +++

Description of problem:
If a CSV does not have an almExamples annotation defined, the create operand form view throws an exception and white screens.

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

How reproducible:
Always

Steps to Reproduce:
1. Create a operand-test project 
2. Create resources from provided yaml attachment
3. Navigate to Operators > Installed Operators
4. Click link to Mock Operator
5. On operator details page, click "Create Instance" on Mock Resource Provided API
6. Click "Edit Form" in the top right and no errors occur
8. Go back to operator details page
9. Go to YAML tab and remove the 'almExamples' annotation
10. Save and go back to overview tab
11. Repeat 5 and 6

Actual results:
You see a blank page and a runtime error is logged in the console

Expected results:
Create operand form should be displayed and no runtime errors should be thrown.

Additional info:
This has been fixed in 4.5 already, but needs to be backported to 4.4

Comment 3 shahan 2020-05-26 04:46:56 UTC
Checked on OCP 4.4 cluster with payload 4.4.0-0.nightly-2020-05-25-115719
1. Create a operand-test project 
2. Create resources from provided yaml attachment
3. Navigate to Operators > Installed Operators
4. Click link to Mock Operator
5. On operator details page, click "Create Instance" on Mock Resource Provided API
6. Click "Edit Form" in the top right and no errors occur
8. Go back to operator details page
9. Go to YAML tab and remove the 'almExamples' annotation
10. Save and go back to overview tab
11. Repeat 5 and 6
The create operand form page is displayed normally. and no runtime error on the page.

Comment 5 errata-xmlrpc 2020-06-02 11:18:33 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:2310