Bug 1799463 - OperatorHub can have duplicate items when 'all projects' is selected, which also breaks filtering
Summary: OperatorHub can have duplicate items when 'all projects' is selected, which a...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.4
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: 4.5.0
Assignee: Daniel Sover
QA Contact: Salvatore Colangelo
URL:
Whiteboard:
: 1797482 1807629 (view as bug list)
Depends On:
Blocks: 1807628 1807629
TreeView+ depends on / blocked
 
Reported: 2020-02-06 17:15 UTC by Jon Jackson
Modified: 2020-07-13 17:14 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1807628 1807629 1807631 1808080 (view as bug list)
Environment:
Last Closed: 2020-07-13 17:14:10 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Demonstration of bug (6.19 MB, image/gif)
2020-02-06 17:15 UTC, Jon Jackson
no flags Details
attachement 1 (42.68 KB, image/png)
2020-03-06 17:18 UTC, Salvatore Colangelo
no flags Details
attachement 2 (59.57 KB, image/png)
2020-03-06 17:19 UTC, Salvatore Colangelo
no flags Details
attachement 3 (64.22 KB, image/png)
2020-03-06 17:19 UTC, Salvatore Colangelo
no flags Details
4.5-1 (49.90 KB, image/png)
2020-03-06 17:33 UTC, Salvatore Colangelo
no flags Details
4.5-2 (60.53 KB, image/png)
2020-03-06 17:34 UTC, Salvatore Colangelo
no flags Details
4.5-3 (68.69 KB, image/png)
2020-03-06 17:34 UTC, Salvatore Colangelo
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1322 0 None closed Bug 1799463: Duplicate packages in packageserver APIService response 2020-06-23 08:25:01 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:14:32 UTC

Internal Links: 1803964

Description Jon Jackson 2020-02-06 17:15:46 UTC
Created attachment 1659194 [details]
Demonstration of bug

Description of problem:

Selecting 'all-projects' on the OperatorHub page causes the operator items on the page to be duplicated and breaks the filtering functionality.

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

How reproducible:
Always under the correct conditions

Steps to Reproduce:
1. Use a 4.4 cluster and ensure the following default sources are available and enabled:
   - redhat-operators
   - certified-operators
   - community-operators
   - redhat-marketplace 
2. Navigate to Operators > OperatorHub
3. Select 'default' from the projects dropdown
4. Note the item count
5. Enter 'test' in the keyword filter
6. Note the filtered item count
7. Select 'all projects' from the projects dropdown
8. Enter 'test' in the keyword filter

Actual results:
Item count is doubled both before and after the filter term is entered and duplicate items are being displayed on the page. Item count also does not match the number of items displayed on the page.

Expected results:
Duplicate items should not be displayed and item count should match the number of items displayed.

Additional info:
Suspect that packageManifest and marketPlacePackageManifest props retreived by firehose component contain overlapping results depending on what catalog sources are available and what namespace is selected. Probably need to either add a special case when all projects is selected, adjust our selectors to ensure no overlap, or add some logic after the call to reduce the package manifest props to a single unique list.

Comment 1 Samuel Padgett 2020-02-11 14:20:49 UTC
*** Bug 1797482 has been marked as a duplicate of this bug. ***

Comment 2 Samuel Padgett 2020-02-21 19:03:15 UTC
It looks like OLM ignores the packagemanifest label selector when listing in all namespaces:

$ oc get packagemanifests -l '!opsrc-owner-name' -n openshift-marketplace
No resources found.

$ oc get packagemanifests -l '!opsrc-owner-name' --all-namespaces | grep openshift-marketplace | wc -l
     198

This is causing console to have duplicate items returned. Here are the queries we run:

https://github.com/kyoto/console/blob/489825edc2533ec696000717ae296f730265fab5/frontend/packages/operator-lifecycle-manager/src/components/operator-hub/operator-hub-page.tsx#L156-L170

Comment 3 Samuel Padgett 2020-02-21 19:50:18 UTC
I created bug 1805994 to add guards to console in case we get duplicates.

Comment 11 Salvatore Colangelo 2020-03-06 17:18:53 UTC
Created attachment 1668170 [details]
attachement 1

Comment 12 Salvatore Colangelo 2020-03-06 17:19:20 UTC
Created attachment 1668171 [details]
attachement 2

Comment 13 Salvatore Colangelo 2020-03-06 17:19:50 UTC
Created attachment 1668172 [details]
attachement 3

Comment 14 Salvatore Colangelo 2020-03-06 17:31:10 UTC
Below the step for 4.4

Steps 
1. Use a 4.4 cluster and ensure the following default sources are available and enabled:
   - redhat-operators
   - certified-operators
   - community-operators
   - redhat-marketplace 

[scolange@scolange ~]$ oc get pod -n openshift-marketplace
NAME                                   READY   STATUS    RESTARTS   AGE
certified-operators-78574454c9-mnsbw   1/1     Running   1          37m
community-operators-54454f7984-sqflh   1/1     Running   1          37m
marketplace-operator-6fb54d4bb-6wvfc   1/1     Running   0          38m
redhat-marketplace-7578c8bfd6-lzmbr    1/1     Running   1          37m
redhat-operators-5ff5ddbc97-hfcf4      1/1     Running   1          37m


2. Navigate to Operators > OperatorHub
3. Select 'default' from the projects dropdown
4. Note the item count
    ##See attachement 1

5. Enter 'test' in the keyword filter
6. Note the filtered item count
   ##See attachement 2 

7. Select 'all projects' from the projects dropdown
8. Enter 'test' in the keyword filter
   ##See attachement 3


[scolange@scolange ~]$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.4.0-0.nightly-2020-03-03-002753   True        False         34m     Cluster version is 4.4.0-0.nightly-2020-03-03-002753





Below the step for 4.5

Steps 
1. Use a 4.5 cluster and ensure the following default sources are available and enabled:
   - redhat-operators
   - certified-operators
   - community-operators
   - redhat-marketplace 

[scolange@scolange ~]$ oc get pod -n openshift-marketplace
NAME                                    READY   STATUS    RESTARTS   AGE
certified-operators-ccf5b4b54-shm7x     1/1     Running   0          173m
community-operators-847f8b4dc4-m4c95    1/1     Running   0          52m
marketplace-operator-7444c86bc6-6h5q8   1/1     Running   0          173m
redhat-marketplace-6554c85479-zmg7t     1/1     Running   0          173m
redhat-operators-67755cd58b-bgb8r       1/1     Running   0          173m


2. Navigate to Operators > OperatorHub
3. Select 'default' from the projects dropdown
4. Note the item count
    ##See attachement 4.5-1

5. Enter 'test' in the keyword filter
6. Note the filtered item count
   ##See attachement 4.5-2 

7. Select 'all projects' from the projects dropdown
8. Enter 'test' in the keyword filter
   ##See attachement 4.5-3




[scolange@scolange ~]$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.5.0-0.nightly-2020-03-06-091857   True        False         163m    Cluster version is 4.5.0-0.nightly-2020-03-06-091857

Comment 15 Salvatore Colangelo 2020-03-06 17:33:51 UTC
Created attachment 1668174 [details]
4.5-1

Comment 16 Salvatore Colangelo 2020-03-06 17:34:19 UTC
Created attachment 1668175 [details]
4.5-2

Comment 17 Salvatore Colangelo 2020-03-06 17:34:44 UTC
Created attachment 1668176 [details]
4.5-3

Comment 18 Evan Cordell 2020-03-12 16:01:26 UTC
*** Bug 1807629 has been marked as a duplicate of this bug. ***

Comment 20 errata-xmlrpc 2020-07-13 17:14:10 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:2409


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