Bug 1910160
| Summary: | If two OperatorConditions include the same deployments they will keep updating the deployment's containers with the OPERATOR_CONDITION_NAME Environment Variable | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | Alexander Greene <agreene> |
| Component: | OLM | Assignee: | Alexander Greene <agreene> |
| OLM sub component: | OLM | QA Contact: | Jian Zhang <jiazha> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | dsover |
| Version: | 4.7 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.7.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause: Most operators managed by OLM do not change the deployment name of their operators between versions.
Consequence: OLM injects an environment variable into Deployments defined in a CSV with the name of the OperatorCondition that they own. When upgrading an operator, two OperatorConditions can exist that define the same deployment.
Fix: The OperatorCondition reconciler will only update adeployments owned by a CSV with the same name of the OperatorCondition.
Result: Two OperatorConditions will not continuously update a deployment that the both define.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2021-02-24 15:48:02 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Alexander Greene
2020-12-22 22:01:11 UTC
Cluster version is 4.7.0-0.nightly-2021-01-04-215816 [root@preserve-olm-env data]# oc -n openshift-operator-lifecycle-manager exec catalog-operator-5b4b6587c4-2qgfb -- olm --version OLM version: 0.17.0 git commit: 69dc076d610b033d3964ed40c4ac27ece3424851 1, Install the etcdoperator v0.9.2 with Manual approval [root@preserve-olm-env data]# cat sub-etcd-cluster.yaml apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: etcd namespace: openshift-operators spec: channel: clusterwide-alpha installPlanApproval: Manual name: etcd source: community-operators sourceNamespace: openshift-marketplace startingCSV: etcdoperator.v0.9.2-clusterwide [root@preserve-olm-env data]# oc create -f sub-etcd-cluster.yaml subscription.operators.coreos.com/etcd created 2, Approve the v0.9.2 installation. [root@preserve-olm-env data]# oc get ip NAME CSV APPROVAL APPROVED install-2b8z7 etcdoperator.v0.9.4-clusterwide Manual false install-tcjbg etcdoperator.v0.9.2-clusterwide Manual true [root@preserve-olm-env data]# oc get csv NAME DISPLAY VERSION REPLACES PHASE etcdoperator.v0.9.2-clusterwide etcd 0.9.2-clusterwide etcdoperator.v0.9.0 Installing [root@preserve-olm-env data]# oc get operatorcondition NAME AGE etcdoperator.v0.9.2-clusterwide 38s 3, Check the v0.9.2 deployment. [root@preserve-olm-env data]# oc get csv NAME DISPLAY VERSION REPLACES PHASE etcdoperator.v0.9.2-clusterwide etcd 0.9.2-clusterwide etcdoperator.v0.9.0 Succeeded [root@preserve-olm-env data]# [root@preserve-olm-env data]# [root@preserve-olm-env data]# oc get deployment NAME READY UP-TO-DATE AVAILABLE AGE etcd-operator 1/1 1 1 3m17s [root@preserve-olm-env data]# oc get deployment etcd-operator -o yaml |grep OPERATOR_CONDITION_NAME But, there is no "OPERATOR_CONDITION_NAME" env var in it. Change the status to "ASSIGNED". Cluster version is 4.7.0-0.nightly-2021-01-14-211319
[root@preserve-olm-env data]# oc -n openshift-operator-lifecycle-manager exec catalog-operator-5b48b7c6b9-rbcxr -- olm --version
OLM version: 0.17.0
git commit: 4a9d02bec674e0398eb5540bdffa13ffd96cd7eb
1, Install the etcdoperator v0.9.2 with Manual approval
[root@preserve-olm-env data]# cat sub-etcd-cluster.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: etcd
namespace: openshift-operators
spec:
channel: clusterwide-alpha
installPlanApproval: Manual
name: etcd
source: community-operators
sourceNamespace: openshift-marketplace
startingCSV: etcdoperator.v0.9.2-clusterwide
[root@preserve-olm-env data]#
[root@preserve-olm-env data]# oc create -f sub-etcd-cluster.yaml
subscription.operators.coreos.com/etcd created
2, Approve the v0.9.2 installation.
[root@preserve-olm-env data]# oc get ip
NAME CSV APPROVAL APPROVED
install-9rxr7 etcdoperator.v0.9.2-clusterwide Manual true
install-sxnzd etcdoperator.v0.9.4-clusterwide Manual false
3, Check the v0.9.2 deployment. The OPERATOR_CONDITION_NAME value is "etcdoperator.v0.9.2-clusterwide", looks good.
[root@preserve-olm-env data]# oc get pod
NAME READY STATUS RESTARTS AGE
etcd-operator-66c87f98c8-q2fvr 3/3 Running 0 4m3s
[root@preserve-olm-env data]# oc get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
etcd-operator 1/1 1 1 4m20s
[root@preserve-olm-env data]# oc get operatorcondition etcdoperator.v0.9.2-clusterwide -o yaml
apiVersion: operators.coreos.com/v1
kind: OperatorCondition
...
spec:
deployments:
- etcd-operator
serviceAccounts:
- etcd-operator
[root@preserve-olm-env data]# oc get deployment -o yaml|grep OPERATOR_CONDITION_NAME -A1
--
- name: OPERATOR_CONDITION_NAME
value: etcdoperator.v0.9.2-clusterwide
--
- name: OPERATOR_CONDITION_NAME
value: etcdoperator.v0.9.2-clusterwide
--
- name: OPERATOR_CONDITION_NAME
value: etcdoperator.v0.9.2-clusterwide
4, Approve the v0.9.4 installation. The OPERATOR_CONDITION_NAME value updated to "etcdoperator.v0.9.4-clusterwide"
[root@preserve-olm-env data]# oc get ip
NAME CSV APPROVAL APPROVED
install-9rxr7 etcdoperator.v0.9.2-clusterwide Manual true
install-sxnzd etcdoperator.v0.9.4-clusterwide Manual true
[root@preserve-olm-env data]# oc get csv
NAME DISPLAY VERSION REPLACES PHASE
etcdoperator.v0.9.2-clusterwide etcd 0.9.2-clusterwide etcdoperator.v0.9.0 Replacing
etcdoperator.v0.9.4-clusterwide etcd 0.9.4-clusterwide etcdoperator.v0.9.2-clusterwide Installing
[root@preserve-olm-env data]# oc get operatorcondition
NAME AGE
etcdoperator.v0.9.4-clusterwide 17s
[root@preserve-olm-env data]# oc get deployment
NAME READY UP-TO-DATE AVAILABLE AGE
etcd-operator 1/1 1 1 7m46s
[root@preserve-olm-env data]# oc get deployment -o yaml|grep OPERATOR_CONDITION_NAME -A1
--
- name: OPERATOR_CONDITION_NAME
value: etcdoperator.v0.9.4-clusterwide
--
- name: OPERATOR_CONDITION_NAME
value: etcdoperator.v0.9.4-clusterwide
--
- name: OPERATOR_CONDITION_NAME
value: etcdoperator.v0.9.4-clusterwide
Looks good to me, verify it.
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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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/RHSA-2020:5633 |