Bug 1835325 - Runtime error on create operand form when almExamples annotation is not defined
Summary: Runtime error on create operand form when almExamples annotation is not defined
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Management Console
Version: 4.5
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.4.z
Assignee: Jon Jackson
QA Contact: Yadan Pei
URL:
Whiteboard:
Depends On: 1835324
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-13 15:39 UTC by Jon Jackson
Modified: 2020-07-06 14:35 UTC (History)
4 users (show)

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.
Clone Of: 1835324
Environment:
Last Closed: 2020-06-02 11:18:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
YAML to create mock operator (23.37 KB, text/plain)
2020-05-13 15:39 UTC, Jon Jackson
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github openshift console pull 5432 0 None closed Bug 1835325: Add default value to buffer prop to prevent runtime error 2020-07-15 21:29:05 UTC
Red Hat Product Errata RHBA-2020:2310 0 None None None 2020-06-02 11:19:09 UTC

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


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