Bug 1827676 - Marketplace operator panics if default CatalogSource does not have polling set
Summary: Marketplace operator panics if default CatalogSource does not have polling set
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.5
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.5.0
Assignee: Anik
QA Contact: yhui
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-04-24 13:52 UTC by Anik
Modified: 2020-07-13 17:31 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-13 17:31:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-marketplace pull 304 0 None closed Bug 1827676: Fix panic when default Catsrc polling is not set 2020-07-15 21:15:58 UTC
Red Hat Product Errata RHBA-2020:2409 0 None None None 2020-07-13 17:31:42 UTC

Description Anik 2020-04-24 13:52:45 UTC
Description of problem:

With the new change to the OperatorHub API accepting both CatalogSources and OperatorSources as defaults, if the default CatalogSource does not have spec.updatestragegy.registrypoll.interval set, the Marketplace Operator panics. 

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

How reproducible:
Always

Steps to Reproduce:

1. Switch community-operators from an OperatorSource https://github.com/operator-framework/operator-marketplace/blob/master/defaults/03_community_operators.yaml to a CatalogSource:

```community-operators.yaml
apiVersion: "operators.coreos.com/v1"
kind: "CatalogSource"
metadata:
  name: "community-operators"
  namespace: "openshift-marketplace"
spec:
  sourceType: grpc
  image: quay.io/operator-framework/upstream-community-operators:latest
  displayName: "Community Operators"
  publisher: "Red Hat"
  updateStrategy:
    registryPoll:
      interval: 45m
 
2. Deploy marketplace-operator with the above change

Actual results:

Marketplace-operator pod status is CrashloopbackOff

Expected results:

Marketplace-operator pod deploys successfully 

Additional info:

Comment 3 yhui 2020-04-28 09:04:31 UTC
Cluster Version: 4.5.0-0.nightly-2020-04-25-170442
Kubernetes Version: v1.18.0-rc.1

Steps to test:
1. Disable the default community-operators in the operatorhub.
$ oc edit operatorhub
  ```
  spec:
    sources:
    - disabled: true
      name: community-operators
  ```
2. Create the catalogsource using the following yaml file.
$ cat community-operators.yaml
apiVersion: "operators.coreos.com/v1"
kind: "CatalogSource"
metadata:
  name: "community-operators"
  namespace: "openshift-marketplace"
spec:
  sourceType: grpc
  image: quay.io/operator-framework/upstream-community-operators:latest
  displayName: "Community Operators"
  publisher: "Red Hat"
  updateStrategy:
    registryPoll:
      interval: 45m
$ oc create -f community-operators.yaml
$ oc get catalogsource -n openshift-marketplace
NAME                  DISPLAY               TYPE   PUBLISHER   AGE
certified-operators   Certified Operators   grpc   Red Hat     4h20m
community-operators   Community Operators   grpc   Red Hat     14s
qe-app-registry                             grpc               4h8m
redhat-marketplace    Red Hat Marketplace   grpc   Red Hat     4h20m
redhat-operators      Red Hat Operators     grpc   Red Hat     4h20m

3. Delete the pod marketplace-operator to let it re-install.
$ oc delete pods marketplace-operator-684575bdb9-85c77 -n openshift-marketplace
pod "marketplace-operator-684575bdb9-85c77" deleted
$ oc get pods -n openshift-marketplace
NAME                                    READY   STATUS    RESTARTS   AGE
certified-operators-654749bc-479v6      1/1     Running   0          3m44s
community-operators-86klx               1/1     Running   0          27s
marketplace-operator-684575bdb9-gkqnh   1/1     Running   0          3m52s
qe-app-registry-58c74f45d4-vc75w        1/1     Running   0          3m41s
redhat-marketplace-6d569cdbd4-z4vkf     1/1     Running   0          3m43s
redhat-operators-847ddf45cb-wz6vz       1/1     Running   0          3m43s

The pod is running normarlly.

4. Delete the community-operators.
$ oc delete -f community-operators.yaml

5. Modify the yaml file to delete the spec.updatestragegy.registrypoll.interval set.
$ cat community-operators.yaml
apiVersion: "operators.coreos.com/v1"
kind: "CatalogSource"
metadata:
  name: "community-operators"
  namespace: "openshift-marketplace"
spec:
  sourceType: grpc
  image: quay.io/operator-framework/upstream-community-operators:latest
  displayName: "Community Operators"
  publisher: "Red Hat"

6. Create the catalogsource using the above yaml file.
$ oc create -f community-operators.yaml
$ oc get catalogsource -n openshift-marketplace
NAME                  DISPLAY               TYPE   PUBLISHER   AGE
certified-operators   Certified Operators   grpc   Red Hat     4h20m
community-operators   Community Operators   grpc   Red Hat     10m
qe-app-registry                             grpc               4h8m
redhat-marketplace    Red Hat Marketplace   grpc   Red Hat     4h20m
redhat-operators      Red Hat Operators     grpc   Red Hat     4h20m

7. Delete the pod marketplace-operator to let it re-install.
$ oc delete pods marketplace-operator-684575bdb9-85c77 -n openshift-marketplace
pod "marketplace-operator-684575bdb9-85c77" deleted
$ oc get pods -n openshift-marketplace
NAME                                    READY   STATUS    RESTARTS   AGE
certified-operators-654749bc-479v6      1/1     Running   0          3m44s
community-operators-86klx               1/1     Running   0          27s
marketplace-operator-684575bdb9-gkqnh   1/1     Running   0          3m52s
qe-app-registry-58c74f45d4-vc75w        1/1     Running   0          3m41s
redhat-marketplace-6d569cdbd4-z4vkf     1/1     Running   0          3m43s
redhat-operators-847ddf45cb-wz6vz       1/1     Running   0          3m43s

The pod is running normarlly.

Comment 4 errata-xmlrpc 2020-07-13 17:31:25 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.