Bug 1750980 - User modifications should be stomped on update
Summary: User modifications should be stomped on update
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.2.0
Assignee: Evan Cordell
QA Contact: Bruno Andrade
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-09-10 22:39 UTC by Evan Cordell
Modified: 2019-10-16 06:41 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-10-16 06:40:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-lifecycle-manager pull 1027 0 None None None 2019-09-10 22:40:39 UTC
Red Hat Product Errata RHBA-2019:2922 0 None None None 2019-10-16 06:41:02 UTC

Description Evan Cordell 2019-09-10 22:39:08 UTC
Description of problem:

If a user manually edits a CSV deployment (for example, changing a cmd flag or an env var) and the CSV is updated from a subscription, the user's changes should not be persisted on the updated CSV. The subscription object should indicate a desire for updates to come from a particular source, and should be removed if this is not the desired behavior.


How reproducible:
Always

Steps to Reproduce:
1. Create a Subscription, manual approval, older starting CSV (e.g. etcd operator v 0.9.2)
2. Modify the CSV to add an Env variable 
3. Approve the installplan to update etcd-operator


Actual results:
The user-added Env var is persisted between updates

Expected results:
The deployment is re-set to the contents of the update, and the env var is not persisted.

Comment 2 Bruno Andrade 2019-09-12 19:13:45 UTC
LGTM, marking as VERIFIED

Custom variable is not persisted to the new csv version as expected and the deployment is reseted.

Cluster Version: 4.2.0-0.nightly-2019-09-12-114308
OLM version: 0.11.0
git commit: 201c8aa7ec382092eef251a0e8c812cc5f7d166a

Steps used to reproduce:

1) Create a namespace:
oc create ns test-operators

2) Create an OperatorGroup:
oc create -f - <<EOF
apiVersion: operators.coreos.com/v1
kind: OperatorGroup
metadata:
  name: test-operators-og
  namespace: test-operators
spec:
  targetNamespaces:
  - test-operators
EOF

3) Create a subscription on v.0.9.2 version with manual approval

oc create -f - <<EOF
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: etcd-etcdoperator.v0.9.2
  namespace: test-operators
spec:
  channel: singlenamespace-alpha
  installPlanApproval: Manual
  name: etcd
  source: community-operators
  sourceNamespace: openshift-marketplace
  startingCSV: etcdoperator.v0.9.2
EOF

4) Add a custom environment variable at CSV

oc edit csv etcdoperator.v0.9.2 -n test-operators

          template:
            metadata:
              labels:
                name: etcd-operator-alm-owned
              name: etcd-operator-alm-owned
            spec:
              containers:
              - command:
                - etcd-operator
                - --create-crd=false
                env:
                - name: MY_POD_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: MY_POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name
                - name: CUSTOM_VARIABLE
                  value: CUSTOM_VALUE
                image: quay.io/coreos/etcd-operator@sha256:c0301e4686c3ed4206e370b42de5a3bd2229b9fb4906cf85f3f30650424abec2
                name: etcd-operator
              - command:
                - etcd-backup-operator
                - --create-crd=false


5) Approve the InstallPlan to Upgrade to etcdoperator.v0.9.4


6) Check if the variable is persisted on the new version:

oc get csv etcdoperator.v0.9.4 -o yaml -n test-operators

          template:
            metadata:
              labels:
                name: etcd-operator-alm-owned
              name: etcd-operator-alm-owned
            spec:
              containers:
              - command:
                - etcd-operator
                - --create-crd=false
                env:
                - name: MY_POD_NAMESPACE
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.namespace
                - name: MY_POD_NAME
                  valueFrom:
                    fieldRef:
                      fieldPath: metadata.name

Custom variable is not added to the new csv version as expected.

Comment 3 errata-xmlrpc 2019-10-16 06:40:54 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-2019:2922


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