Bug 2065804

Summary: Console backend check for Web Terminal Operator incorrectly returns HTTP 204
Product: OpenShift Container Platform Reporter: Angel Misevski <amisevsk>
Component: Dev ConsoleAssignee: Angel Misevski <amisevsk>
Status: CLOSED ERRATA QA Contact: spathak <spathak>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.8CC: aos-bugs, jakumar, nmukherj, spadgett, viraj
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:54:40 UTC Type: Bug
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:    
Bug Blocks: 2077142    

Description Angel Misevski 2022-03-18 18:21:36 UTC
Description of problem:
This is a regression coming from [1]. In enabling the OpenShift Console to search all namespaces for a Web Terminal Operator installation, the logic for checking if the operator is installed was changed from

  "Get subscriptions.operators.coreos.com 
   in namespace openshift-operators named 'web-terminal'"

to

  "List subscriptions.operators.coreos.com 
   in cluster named 'web-terminal'"

In the first case, the API returns "not found" if the subscription does not exist. However, in the updated check, the API will return an empty list instead. The console still checks for the "not found" response, and so misses that the list of subscriptions is empty and assumes the operator is present.

There are further checks that the console does, so in most cases the request to the `/api/terminal/available` endpoint still returns the correct result. However, if the cluster has the DevWorkspace Operator installed independently of the Web Terminal Operator [2], these further checks succeed and the Web Terminal UI button is shown incorrectly.

[1] - https://bugzilla.redhat.com/show_bug.cgi?id=2006329
[2] - Background: the DevWorkspace Operator is a dependency of the Web Terminal Operator that provides required webhooks and custom resource definitions.


Version-Release number of selected component (if applicable): 4.8, 4.9, 4.10


How reproducible: Always


Steps to Reproduce:
1. Install the DevWorkspace Operator in the cluster via OperatorHub
2. Refresh OpenShift Console web page


Actual results:
* Web Terminal button is visible in top-right ('>_').
* Browser network requests during page load returns HTTP 204 for /api/terminal/available.

Expected results:
* Console backend does not return HTTP 204 until Web Terminal Operator is installed.
* Web Terminal button is not present in UI until Web Terminal Operator is installed.

Additional info:

Comment 3 Vikram Raj 2022-04-22 12:00:22 UTC
Verified it on 4.11.0-0.nightly-2022-04-22-002610.And it works as expected.

Comment 5 errata-xmlrpc 2022-08-10 10:54:40 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 (Important: OpenShift Container Platform 4.11.0 bug fix and security update), 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/RHSA-2022:5069