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.
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
*** Bug 1821580 has been marked as a duplicate of this bug. ***
*** Bug 1833789 has been marked as a duplicate of this bug. ***
*** Bug 1842006 has been marked as a duplicate of this bug. ***
*** Bug 1851798 has been marked as a duplicate of this bug. ***
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.
*** Bug 1870502 has been marked as a duplicate of this bug. ***
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
*** Bug 1913153 has been marked as a duplicate of this bug. ***