Bug 1867821 - Default sources in marketplace are not ranked in order of preference
Summary: Default sources in marketplace are not ranked in order of preference
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: unspecified
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 4.6.0
Assignee: Anik
QA Contact: Jian Zhang
Depends On:
TreeView+ depends on / blocked
Reported: 2020-08-10 21:42 UTC by Anik
Modified: 2020-08-26 10:55 UTC (History)
0 users

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed:
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Github operator-framework operator-marketplace pull 329 None open Bug 1867821: Include spec.priority for default sources 2020-08-25 19:23:15 UTC

Description Anik 2020-08-10 21:42:54 UTC
Description of problem:

The CatalogSource api was enhanced with a spec.priority field (https://github.com/operator-framework/api/pull/49) that is now used for dependency resolution(https://github.com/operator-framework/operator-lifecycle-manager/pull/1706). 

The default sources in marketplace (https://github.com/operator-framework/operator-marketplace/tree/master/defaults) should include the priority field to rank the sources for the dependency resolver. 

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

How reproducible:

Steps to Reproduce:
1. Install an operator that is provided by both redhat-operators and community-operators using the console

Actual results:

The operator installed cannot be predicted to be from either of redhat-operators or community-operators. Repeating step 1 produces different results everytime 

Expected results:

Operator should be installed from the redhat-operators as that catalog should be ranked higher in an OCP cluster. 

Additional info:

Comment 3 Jian Zhang 2020-08-26 10:55:58 UTC
LGTM, veirfy it. Details:
[root@preserve-olm-env data]# oc exec marketplace-operator-6476f45dcb-bt2wq -- marketplace-operator --version
Marketplace source git commit: 0c3267ec28a71f25533bee9f541ae044c5883b69
time="2020-08-26T10:38:31Z" level=info msg="Go Version: go1.14.4"
time="2020-08-26T10:38:31Z" level=info msg="Go OS/Arch: linux/amd64"
time="2020-08-26T10:38:31Z" level=info msg="operator-sdk Version: v0.8.0"

[root@preserve-olm-env data]# oc get catalogsource
NAME                  DISPLAY                TYPE   PUBLISHER      AGE
certified-operators   Certified Operators    grpc   Red Hat        26m
community-operators   Community Operators    grpc   Red Hat        26m
qe-app-registry       Production Operators   grpc   OpenShift QE   9m21s
redhat-marketplace    Red Hat Marketplace    grpc   Red Hat        26m
redhat-operators      Red Hat Operators      grpc   Red Hat        26m

[root@preserve-olm-env data]# oc get catalogsource redhat-operators -o=jsonpath='{.spec.priority}'
[root@preserve-olm-env data]# oc get catalogsource certified-operators -o=jsonpath='{.spec.priority}'
[root@preserve-olm-env data]# oc get catalogsource redhat-marketplace -o=jsonpath='{.spec.priority}'
[root@preserve-olm-env data]# oc get catalogsource community-operators -o=jsonpath='{.spec.priority}'

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