Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1746054

Summary: Set limit on length of conditions in csv
Product: OpenShift Container Platform Reporter: Abu Kashem <akashem>
Component: OLMAssignee: Abu Kashem <akashem>
OLM sub component: OLM QA Contact: Jian Zhang <jiazha>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: bandrade, chuo, ecordell, jfan, scolange
Version: 4.2.0   
Target Milestone: ---   
Target Release: 4.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-16 06:37:54 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 Abu Kashem 2019-08-27 14:44:49 UTC
Set a limit on length of conditions in csv. Today conditions grow unbounded and this makes it difficult for the user to work with the object. 
- Set the limit to 20, so the conditions array size will never grow beyond 20. 
- Also ensure that we prune the oldest condition type from the array once we reach the limit.

Comment 5 Jian Zhang 2019-08-29 08:07:32 UTC
Cluster version is 4.2.0-0.nightly-2019-08-28-035628
mac:~ jianzhang$ oc exec catalog-operator-9d8bc57c-5v67r -- olm --version
OLM version: 0.11.0
git commit: 2959328fba0d1909ff9f24b365c2d8acbd3a19da


LGTM, verify it, details as below. @Au I think we should use an easier way to verify it, do you any suggestion? Thanks!

1) Install the OCP 4.2
2) Install an operator, which will fail to install. For example, MongoDB
3) Check the csv of the MongoDB, status.conditions field. The pod of the MongoDB will be in Pending status.
4) Delete the MongoDB pods so that trigger the csv status.conditions filed update.

mac:~ jianzhang$ oc delete pods mongodb-enterprise-operator-8574c87ccc-k9ccm 
pod "mongodb-enterprise-operator-8574c87ccc-k9ccm" deleted

mac:~ jianzhang$ oc get pods
NAME                                               READY   STATUS    RESTARTS   AGE
mongodb-enterprise-operator-8574c87ccc-lfhfq       0/1     Pending   0          56s

5) After deleting the MongoDB pods twice, the number of this status.conditions will reach 20. Like below:

mac:~ jianzhang$ oc get csv mongodb-enterprise.v1.1.0   -o yaml
...
status:
  certsLastUpdated: null
  certsRotateAt: null
  conditions:
  - lastTransitionTime: "2019-08-29T05:49:15Z"
    lastUpdateTime: "2019-08-29T05:49:15Z"
    message: requirements not yet checked
    phase: Pending
    reason: RequirementsUnknown
  - lastTransitionTime: "2019-08-29T05:49:36Z"
    lastUpdateTime: "2019-08-29T05:49:36Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  - lastTransitionTime: "2019-08-29T05:49:42Z"
    lastUpdateTime: "2019-08-29T05:49:42Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T05:49:42Z"
    lastUpdateTime: "2019-08-29T05:50:38Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T05:54:41Z"
    lastUpdateTime: "2019-08-29T05:54:41Z"
    message: install timeout
    phase: Failed
    reason: InstallCheckFailed
  - lastTransitionTime: "2019-08-29T05:54:43Z"
    lastUpdateTime: "2019-08-29T05:54:43Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Pending
    reason: NeedsReinstall
  - lastTransitionTime: "2019-08-29T05:54:44Z"
    lastUpdateTime: "2019-08-29T05:54:44Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  - lastTransitionTime: "2019-08-29T05:54:45Z"
    lastUpdateTime: "2019-08-29T05:54:45Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T05:54:45Z"
    lastUpdateTime: "2019-08-29T05:54:46Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T05:59:46Z"
    lastUpdateTime: "2019-08-29T05:59:46Z"
    message: 'install failed: Timeout: deployment mongodb-enterprise-operator not
      ready before timeout: deployment "mongodb-enterprise-operator" exceeded its
      progress deadline'
    phase: Failed
    reason: InstallCheckFailed
  - lastTransitionTime: "2019-08-29T07:36:22Z"
    lastUpdateTime: "2019-08-29T07:36:22Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Pending
    reason: NeedsReinstall
  - lastTransitionTime: "2019-08-29T07:36:58Z"
    lastUpdateTime: "2019-08-29T07:36:58Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  - lastTransitionTime: "2019-08-29T07:38:20Z"
    lastUpdateTime: "2019-08-29T07:38:20Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T07:38:20Z"
    lastUpdateTime: "2019-08-29T07:39:04Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T07:43:44Z"
    lastUpdateTime: "2019-08-29T07:43:44Z"
    message: install timeout
    phase: Failed
    reason: InstallCheckFailed
  - lastTransitionTime: "2019-08-29T07:43:45Z"
    lastUpdateTime: "2019-08-29T07:43:45Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Pending
    reason: NeedsReinstall
  - lastTransitionTime: "2019-08-29T07:44:07Z"
    lastUpdateTime: "2019-08-29T07:44:07Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  - lastTransitionTime: "2019-08-29T07:44:10Z"
    lastUpdateTime: "2019-08-29T07:44:10Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T07:44:10Z"
    lastUpdateTime: "2019-08-29T07:44:11Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T07:46:45Z"
    lastUpdateTime: "2019-08-29T07:46:45Z"
    message: 'install failed: Timeout: deployment mongodb-enterprise-operator not
      ready before timeout: deployment "mongodb-enterprise-operator" exceeded its
      progress deadline'
    phase: Failed
    reason: InstallCheckFailed
  lastTransitionTime: "2019-08-29T07:46:45Z"
  lastUpdateTime: "2019-08-29T07:46:45Z"
  message: 'install failed: Timeout: deployment mongodb-enterprise-operator not ready
    before timeout: deployment "mongodb-enterprise-operator" exceeded its progress
    deadline'
  phase: Failed
  reason: InstallCheckFailed
  requirementStatus:
...

7) repeat step 4) and check the status.condittions field again.
mac:~ jianzhang$ oc get csv mongodb-enterprise.v1.1.0   -o yaml
...
status:
  certsLastUpdated: null
  certsRotateAt: null
  conditions:
  - lastTransitionTime: "2019-08-29T05:49:42Z"
    lastUpdateTime: "2019-08-29T05:49:42Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T05:49:42Z"
    lastUpdateTime: "2019-08-29T05:50:38Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T05:54:41Z"
    lastUpdateTime: "2019-08-29T05:54:41Z"
    message: install timeout
    phase: Failed
    reason: InstallCheckFailed
  - lastTransitionTime: "2019-08-29T05:54:43Z"
    lastUpdateTime: "2019-08-29T05:54:43Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Pending
    reason: NeedsReinstall
  - lastTransitionTime: "2019-08-29T05:54:44Z"
    lastUpdateTime: "2019-08-29T05:54:44Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  - lastTransitionTime: "2019-08-29T05:54:45Z"
    lastUpdateTime: "2019-08-29T05:54:45Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T05:54:45Z"
    lastUpdateTime: "2019-08-29T05:54:46Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T05:59:46Z"
    lastUpdateTime: "2019-08-29T05:59:46Z"
    message: 'install failed: Timeout: deployment mongodb-enterprise-operator not
      ready before timeout: deployment "mongodb-enterprise-operator" exceeded its
      progress deadline'
    phase: Failed
    reason: InstallCheckFailed
  - lastTransitionTime: "2019-08-29T07:36:22Z"
    lastUpdateTime: "2019-08-29T07:36:22Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Pending
    reason: NeedsReinstall
  - lastTransitionTime: "2019-08-29T07:36:58Z"
    lastUpdateTime: "2019-08-29T07:36:58Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  - lastTransitionTime: "2019-08-29T07:38:20Z"
    lastUpdateTime: "2019-08-29T07:38:20Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T07:38:20Z"
    lastUpdateTime: "2019-08-29T07:39:04Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T07:43:44Z"
    lastUpdateTime: "2019-08-29T07:43:44Z"
    message: install timeout
    phase: Failed
    reason: InstallCheckFailed
  - lastTransitionTime: "2019-08-29T07:43:45Z"
    lastUpdateTime: "2019-08-29T07:43:45Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Pending
    reason: NeedsReinstall
  - lastTransitionTime: "2019-08-29T07:44:07Z"
    lastUpdateTime: "2019-08-29T07:44:07Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  - lastTransitionTime: "2019-08-29T07:44:10Z"
    lastUpdateTime: "2019-08-29T07:44:10Z"
    message: waiting for install components to report healthy
    phase: Installing
    reason: InstallSucceeded
  - lastTransitionTime: "2019-08-29T07:44:10Z"
    lastUpdateTime: "2019-08-29T07:44:11Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Installing
    reason: InstallWaiting
  - lastTransitionTime: "2019-08-29T07:46:45Z"
    lastUpdateTime: "2019-08-29T07:46:45Z"
    message: 'install failed: Timeout: deployment mongodb-enterprise-operator not
      ready before timeout: deployment "mongodb-enterprise-operator" exceeded its
      progress deadline'
    phase: Failed
    reason: InstallCheckFailed
  - lastTransitionTime: "2019-08-29T07:51:22Z"
    lastUpdateTime: "2019-08-29T07:51:22Z"
    message: |
      installing: Waiting: waiting for deployment mongodb-enterprise-operator to become ready: Waiting for rollout to finish: 0 of 1 updated replicas are available...
    phase: Pending
    reason: NeedsReinstall
  - lastTransitionTime: "2019-08-29T07:51:34Z"
    lastUpdateTime: "2019-08-29T07:51:34Z"
    message: all requirements found, attempting install
    phase: InstallReady
    reason: AllRequirementsMet
  lastTransitionTime: "2019-08-29T07:51:34Z"
  lastUpdateTime: "2019-08-29T07:51:34Z"
  message: all requirements found, attempting install
  phase: InstallReady
  reason: AllRequirementsMet
  requirementStatus:
...

From above we can see, the number of status.condittions always is 20, and the old condition has been removed. Verify it.

Comment 6 errata-xmlrpc 2019-10-16 06:37: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

Comment 7 Red Hat Bugzilla 2023-09-14 05:42:24 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days