Bug 1945149 - [release-4.6] When deploying the operator via OLM (after creating the respective catalogsource), the deployment "lost" the `resources` section.
Summary: [release-4.6] When deploying the operator via OLM (after creating the respect...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: x86_64
OS: Linux
high
medium
Target Milestone: ---
: 4.6.z
Assignee: Joe Lanford
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On: 1937375
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-03-31 12:37 UTC by Joe Lanford
Modified: 2021-05-20 11:53 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1937375
Environment:
Last Closed: 2021-05-20 11:52:25 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 2071 0 None open [release-4.6] Bug 1945149: only override deployment resources when explicitly defined in subscription config 2021-03-31 14:53:49 UTC
Red Hat Product Errata RHBA-2021:1521 0 None None None 2021-05-20 11:53:02 UTC

Comment 5 Jian Zhang 2021-05-11 02:40:18 UTC
mac:openshift-tests-private jianzhang$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-0.nightly-2021-05-08-154328   True        False         2m13s   Cluster version is 4.6.0-0.nightly-2021-05-08-154328

1, Create the CatalogSource
mac:openshift-tests-private jianzhang$ cat cs-bug.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  labels:
    olm-visibility: hidden
    opsrc-datastore: "true"
    opsrc-provider: reproducer
  name: reproducer-operators
  namespace: openshift-marketplace
spec:
  displayName: Reproducer Operators
  icon:
    base64data: ""
    mediatype: ""
  image: quay.io/jaeichle/reproducer-hello-world-index:0.0.1
  priority: -400
  publisher: jaeichle
  sourceType: grpc
  updateStrategy:
    registryPoll:
      interval: 100m0s
mac:openshift-tests-private jianzhang$ oc create -f cs-bug.yaml 
catalogsource.operators.coreos.com/reproducer-operators created

2, Subscribe to the helloworld-operator
mac:openshift-tests-private jianzhang$ cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: helloworld-operator
  namespace: default
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: helloworld-operator
  source: reproducer-operators
  sourceNamespace: openshift-marketplace
  startingCSV: helloworld-operator.v0.0.1

mac:openshift-tests-private jianzhang$ oc get sub -n default
NAME                  PACKAGE               SOURCE                 CHANNEL
helloworld-operator   helloworld-operator   reproducer-operators   alpha

3, Check the resources of the CSV and Deployment, they should be same.
mac:openshift-tests-private jianzhang$ oc get csv helloworld-operator.v0.0.1  -o yaml -n default | grep limit -A 5
                  limits:
                    cpu: 500m
                    memory: 500Mi
                  requests:
                    cpu: 100m
                    memory: 100Mi

mac:openshift-tests-private jianzhang$ oc get deployment -n default helloworld-operator -o yaml |grep limit -A 5

          limits:
            cpu: 500m
            memory: 500Mi
          requests:
            cpu: 100m
            memory: 100Mi

mac:openshift-tests-private jianzhang$ oc get pods helloworld-operator-76cc59cb89-5hlmt -n default -o yaml |grep limit -A 5

      limits:
        cpu: 500m
        memory: 500Mi
      requests:
        cpu: 100m
        memory: 100Mi

4, add `subscription.spec.config.resources` to the subscription. Like: 

mac:openshift-tests-private jianzhang$ cat sub.yaml 
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: helloworld-operator
  namespace: default
spec:
  channel: alpha
  installPlanApproval: Automatic
  name: helloworld-operator
  source: reproducer-operators
  sourceNamespace: openshift-marketplace
  startingCSV: helloworld-operator.v0.0.1
  config:
    resources:
      limits:
        cpu: 300m
        memory: 500Mi
      requests:
        cpu: 100m
        memory: 100Mi
mac:openshift-tests-private jianzhang$ oc apply -f sub.yaml 
Warning: oc apply should be used on resource created by either oc create --save-config or oc apply
subscription.operators.coreos.com/helloworld-operator configured

The resources of deployment have been changed to cpu 300m from 500m.
mac:openshift-tests-private jianzhang$ oc get deployment -n default helloworld-operator -o yaml |grep limit -A 5

          limits:
            cpu: 300m
            memory: 500Mi
          requests:
            cpu: 100m
            memory: 100Mi

The resources of CSV not changed.
mac:openshift-tests-private jianzhang$  oc get csv helloworld-operator.v0.0.1  -o yaml -n default | grep limit -A 5
                  limits:
                    cpu: 500m
                    memory: 500Mi
                  requests:
                    cpu: 100m
                    memory: 100Mi

LGTM, verify it.

Comment 7 errata-xmlrpc 2021-05-20 11:52: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 (OpenShift Container Platform 4.6.29 bug fix update), 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-2021:1521


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