Bug 1814822 - OperatorHub console doesn't display the same operator in 2 different CatalogSource
Summary: OperatorHub console doesn't display the same operator in 2 different CatalogS...
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.4
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: ---
: 4.7.0
Assignee: Evan Cordell
QA Contact: Jian Zhang
URL:
Whiteboard:
: 1821580 1833789 1842006 1851798 1870502 1913153 (view as bug list)
Depends On:
Blocks: 1820779
TreeView+ depends on / blocked
 
Reported: 2020-03-18 17:52 UTC by Vu Dinh
Modified: 2021-01-08 11:04 UTC (History)
14 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1820779 (view as bug list)
Environment:
Last Closed: 2020-10-21 13:35:33 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Vu Dinh 2020-03-18 17:52:10 UTC
Description of problem:

The console for OperatorHub is unable to display duplicate operator/package from different CatalogSource.

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


How reproducible:
Clone one of default OperatorSource (community/redhat-operators) and change the name and then deploy it in openshift-marketplace namespace.

Steps to Reproduce:
1. Create a clone OperatorSource of redhat-operators and change it name:
```
apiVersion: "operators.coreos.com/v1"
kind: "OperatorSource"
metadata:
  name: "community-operators-2"
  namespace: "openshift-marketplace"
  labels:
    opsrc-provider: community
spec:
  type: appregistry
  endpoint: "https://quay.io/cnr"
  registryNamespace: "community-operators"
  displayName: "Community Operators 2"
  publisher: "Red Hat"
```

2. Deploy the cloned OperatorSource in `openshift-marketplace` namespace.
3. Using oc command to check for etcd operator and you should see two copies of etcd operator in 2 different CatalogSource
```
$ oc get packagemanifest | grep etcd
etcd                                         Community Operators     82m
etcd                                         Community Operators 2   18m
```
4. Check the OperatorHub UI, you only see one etcd operator displayed.

Actual results:
Only one copy of etcd operator is displayed in the UI.

Expected results:
There should be 2 copies of etcd operator displayed in OperatorHub.

Additional info:
This is originated from this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1786471
The original issue was when the same operator exists in 2 different catalogsources in the same namespace, there was a key collision in packagemanifest cache. As a result, only one copy was displayed in both UI and via CLI query. When one of the two catalogsources was removed, the operator disappeared from both UI and CLI as the key was deleted from the map in cache. This issue has been resolved as the above PR is verified. Now via CLI, you can clearly see both copies of the same operator listed in 2 different catalogsources. However, UI doesn't seem to do so.
Another note is when I create a custom CatalogSource directly (not via OperatorSource) using a custom image that contains etcd operator, both copies of etcd are displayed correctly in UI and CLI. This issue seems to involve appregistry catalogsource and/or OperatorSource somehow but I haven't found a connection.

Comment 2 Samuel Padgett 2020-04-07 14:59:30 UTC
OLM is returning two resources with the same name in the same namespace. This isn't allowed in Kubernetes. It's problematic even outside of console since it's unclear what `oc describe packagemanifest etcd` will return. Which etcd instance will you get?

Changing component to OLM. This can't be fixed in console alone.

$ oc get packagemanifests --field-selector 'metadata.name=etcd' -n openshift-operators
NAME   CATALOG                 AGE
etcd   Community Operators 2   139m
etcd   Community Operators     172m

$ oc explain packagemanifests.metadata.name
KIND:     PackageManifest
VERSION:  packages.operators.coreos.com/v1

FIELD:    name <string>

DESCRIPTION:
     Name must be unique within a namespace. Is required when creating
     resources, although some resources may allow a client to request the
     generation of an appropriate name automatically. Name is primarily intended
     for creation idempotence and configuration definition. Cannot be updated.
     More info: http://kubernetes.io/docs/user-guide/identifiers#names

Comment 4 Samuel Padgett 2020-04-29 19:59:42 UTC
*** Bug 1821580 has been marked as a duplicate of this bug. ***

Comment 6 Robb Hamilton 2020-05-14 17:33:41 UTC
*** Bug 1833789 has been marked as a duplicate of this bug. ***

Comment 7 Samuel Padgett 2020-05-18 14:36:42 UTC
*** Bug 1833789 has been marked as a duplicate of this bug. ***

Comment 9 Samuel Padgett 2020-06-01 17:03:57 UTC
*** Bug 1842006 has been marked as a duplicate of this bug. ***

Comment 12 Samuel Padgett 2020-07-07 14:47:16 UTC
*** Bug 1851798 has been marked as a duplicate of this bug. ***

Comment 15 Evan Cordell 2020-08-10 13:26:39 UTC
The console has implemented some changes that make allow it to deal with the duplicates, but this still needs to be considered as something to address for OLM, since the packageserver semantics don't match kube api expectations.

Comment 16 Robb Hamilton 2020-08-21 13:47:18 UTC
*** Bug 1870502 has been marked as a duplicate of this bug. ***

Comment 20 Evan Cordell 2020-10-21 13:35:33 UTC
Consensus is that this cannot be fixed and backported without breaking existing clients, so I have added a story to work on it as part of feature work for 4.7: https://issues.redhat.com/browse/OLM-2002

Comment 21 Simone Tiraboschi 2021-01-08 11:04:15 UTC
*** Bug 1913153 has been marked as a duplicate of this bug. ***


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