Bug 1880220 - only the last condition of status of csv is displayed in Operator's refs
Summary: only the last condition of status of csv is displayed in Operator's refs
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Evan Cordell
QA Contact: kuiwang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-09-18 01:45 UTC by kuiwang
Modified: 2020-09-18 12:30 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-09-18 12:30:15 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description kuiwang 2020-09-18 01:45:18 UTC
Description of problem:
we find it during the verification of https://bugzilla.redhat.com/show_bug.cgi?id=1829735, so it should be introduced by it.

There are some conditions of csv and all these conditions are displayed in refs of Operator resource as previous behavior which we expect to let user can see all conditions.
but now only the last one of csv is displayed in refs of Operator resource.

For example, here the conditions of csv
--
kuiwang@Kuis-MacBook-Pro 1829735 % oc get csv etcdoperator.v0.9.4 -o=jsonpath='{.status}'|jq .
{
  "conditions": [
    {
      "lastTransitionTime": "2020-09-18T01:19:40Z",
      "lastUpdateTime": "2020-09-18T01:19:40Z",
      "message": "requirements not yet checked",
      "phase": "Pending",
      "reason": "RequirementsUnknown"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:41Z",
      "lastUpdateTime": "2020-09-18T01:19:41Z",
      "message": "all requirements found, attempting install",
      "phase": "InstallReady",
      "reason": "AllRequirementsMet"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:41Z",
      "lastUpdateTime": "2020-09-18T01:19:41Z",
      "message": "waiting for install components to report healthy",
      "phase": "Installing",
      "reason": "InstallSucceeded"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:41Z",
      "lastUpdateTime": "2020-09-18T01:19:41Z",
      "message": "installing: waiting for deployment etcd-operator to become ready: Waiting for deployment spec update to be observed...\n",
      "phase": "Installing",
      "reason": "InstallWaiting"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:50Z",
      "lastUpdateTime": "2020-09-18T01:19:50Z",
      "message": "install strategy completed with no errors",
      "phase": "Succeeded",
      "reason": "InstallSucceeded"
    }
  ],
  "lastTransitionTime": "2020-09-18T01:19:50Z",
  "lastUpdateTime": "2020-09-18T01:19:50Z",
  "message": "install strategy completed with no errors",
  "phase": "Succeeded",
  "reason": "InstallSucceeded",
...
}

we expect them displayed on Operator resource as they did before.
but we can only see the last one in refs of Operator resource

kuiwang@Kuis-MacBook-Pro 1829735 % oc get operator etcd.default -o=json | jq .                
{
  "apiVersion": "operators.coreos.com/v1",
  "kind": "Operator",
  "metadata": {
  ...
    "name": "etcd.default",
    "resourceVersion": "124663",
    "selfLink": "/apis/operators.coreos.com/v1/operators/etcd.default",
    "uid": "2d696d7f-0313-47b3-8e0d-5470abcc6497"
  },
  "spec": {},
  "status": {
    "components": {
      "labelSelector": {
        "matchExpressions": [
          {
            "key": "operators.coreos.com/etcd.default",
            "operator": "Exists"
          }
        ]
      },
      "refs": [
        {
        ...
        {
          "apiVersion": "operators.coreos.com/v1alpha1",
          "conditions": [
            {
              "lastTransitionTime": "2020-09-18T01:19:50Z",
              "lastUpdateTime": "2020-09-18T01:19:50Z",
              "message": "install strategy completed with no errors",
              "reason": "InstallSucceeded",
              "status": "True",
              "type": "Succeeded"
            }
          ],
          "kind": "ClusterServiceVersion",
          "name": "etcdoperator.v0.9.4",
          "namespace": "default"
        }
      ]
    }
  }
}


--

Version-Release number of selected component (if applicable):
kuiwang@Kuis-MacBook-Pro 1829735 % oc exec catalog-operator-7b76596b48-mg47w -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.16.1
git commit: 78bb41b4613cafca7264a3108d1f1fa4b66024c8

How reproducible:
always

Steps to Reproduce:

---
kuiwang@Kuis-MacBook-Pro 1829735 % oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.6.0-0.nightly-2020-09-17-050000   True        False         96m     Cluster version is 4.6.0-0.nightly-2020-09-17-050000
kuiwang@Kuis-MacBook-Pro 1829735 % oc exec catalog-operator-7b76596b48-mg47w -n openshift-operator-lifecycle-manager -- olm --version
OLM version: 0.16.1
git commit: 78bb41b4613cafca7264a3108d1f1fa4b66024c8
kuiwang@Kuis-MacBook-Pro 1829735 % cat og-single.yaml 
kind: OperatorGroup
apiVersion: operators.coreos.com/v1
metadata:
  name: og-single
  namespace: default
spec:
  targetNamespaces:
  - default

kuiwang@Kuis-MacBook-Pro 1829735 % oc apply -f og-single.yaml 
cat catsrc.yamloperatorgroup.operators.coreos.com/og-single created
kuiwang@Kuis-MacBook-Pro 1829735 % cat catsrc.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
  name: test-operators
  namespace: default
spec:
  image: quay.io/kuiwang/olm-api:v1
  displayName: Test Operators
  icon:
    base64data: ""
    mediatype: ""
  publisher: Red Hat
  sourceType: grpc
  updateStrategy:
    registryPoll:
      interval: 10m0s
kuiwang@Kuis-MacBook-Pro 1829735 % oc apply -f catsrc.yaml 
catalogsource.operators.coreos.com/test-operators created
kuiwang@Kuis-MacBook-Pro 1829735 % cat sub.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: etcd
  namespace: default
spec:
  channel: singlenamespace-alpha
  installPlanApproval: Automatic
  name: etcd
  source: test-operators
  sourceNamespace: default
  startingCSV: etcdoperator.v0.9.4
kuiwang@Kuis-MacBook-Pro 1829735 % oc apply -f sub.yaml
subscription.operators.coreos.com/etcd created
kuiwang@Kuis-MacBook-Pro 1829735 % oc get csv
NAME                  DISPLAY   VERSION   REPLACES              PHASE
etcdoperator.v0.9.4   etcd      0.9.4     etcdoperator.v0.9.2   Succeeded

kuiwang@Kuis-MacBook-Pro 1829735 % oc get operator etcd.default -o=json | jq .                
{
  "apiVersion": "operators.coreos.com/v1",
  "kind": "Operator",
  "metadata": {
    "creationTimestamp": "2020-09-18T01:19:34Z",
    "generation": 1,
    ...
    "name": "etcd.default",
    "resourceVersion": "124663",
    "selfLink": "/apis/operators.coreos.com/v1/operators/etcd.default",
    "uid": "2d696d7f-0313-47b3-8e0d-5470abcc6497"
  },
  "spec": {},
  "status": {
    "components": {
      "labelSelector": {
        "matchExpressions": [
          {
            "key": "operators.coreos.com/etcd.default",
            "operator": "Exists"
          }
        ]
      },
      "refs": [
        ...
        {
          "apiVersion": "operators.coreos.com/v1alpha1",
          "conditions": [
            {
              "lastTransitionTime": "2020-09-18T01:19:50Z",
              "lastUpdateTime": "2020-09-18T01:19:50Z",
              "message": "install strategy completed with no errors",
              "reason": "InstallSucceeded",
              "status": "True",
              "type": "Succeeded"
            }
          ],
          "kind": "ClusterServiceVersion",
          "name": "etcdoperator.v0.9.4",
          "namespace": "default"
        }
      ]
    }
  }
}

kuiwang@Kuis-MacBook-Pro 1829735 % oc get csv etcdoperator.v0.9.4 -o=jsonpath='{.status}'|jq .
{
  "conditions": [
    {
      "lastTransitionTime": "2020-09-18T01:19:40Z",
      "lastUpdateTime": "2020-09-18T01:19:40Z",
      "message": "requirements not yet checked",
      "phase": "Pending",
      "reason": "RequirementsUnknown"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:41Z",
      "lastUpdateTime": "2020-09-18T01:19:41Z",
      "message": "all requirements found, attempting install",
      "phase": "InstallReady",
      "reason": "AllRequirementsMet"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:41Z",
      "lastUpdateTime": "2020-09-18T01:19:41Z",
      "message": "waiting for install components to report healthy",
      "phase": "Installing",
      "reason": "InstallSucceeded"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:41Z",
      "lastUpdateTime": "2020-09-18T01:19:41Z",
      "message": "installing: waiting for deployment etcd-operator to become ready: Waiting for deployment spec update to be observed...\n",
      "phase": "Installing",
      "reason": "InstallWaiting"
    },
    {
      "lastTransitionTime": "2020-09-18T01:19:50Z",
      "lastUpdateTime": "2020-09-18T01:19:50Z",
      "message": "install strategy completed with no errors",
      "phase": "Succeeded",
      "reason": "InstallSucceeded"
    }
  ],
  "lastTransitionTime": "2020-09-18T01:19:50Z",
  "lastUpdateTime": "2020-09-18T01:19:50Z",
  "message": "install strategy completed with no errors",
  "phase": "Succeeded",
  "reason": "InstallSucceeded",
  "requirementStatus": [
    {
      "group": "apiextensions.k8s.io",
      "kind": "CustomResourceDefinition",
      "message": "CRD is present and Established condition is true",
      "name": "etcdbackups.etcd.database.coreos.com",
      "status": "Present",
      "uuid": "07b2fec5-cdf9-44f8-b685-73bcb9ac79df",
      "version": "v1"
    },
    {
      "group": "apiextensions.k8s.io",
      "kind": "CustomResourceDefinition",
      "message": "CRD is present and Established condition is true",
      "name": "etcdclusters.etcd.database.coreos.com",
      "status": "Present",
      "uuid": "9f5c66d6-581f-40cc-aeca-549bba9b409b",
      "version": "v1"
    },
    {
      "group": "apiextensions.k8s.io",
      "kind": "CustomResourceDefinition",
      "message": "CRD is present and Established condition is true",
      "name": "etcdrestores.etcd.database.coreos.com",
      "status": "Present",
      "uuid": "573a5170-0e8d-4a2f-a1cf-196e8afdcb70",
      "version": "v1"
    },
    {
      "dependents": [
        {
          "group": "rbac.authorization.k8s.io",
          "kind": "PolicyRule",
          "message": "namespaced rule:{\"verbs\":[\"*\"],\"apiGroups\":[\"etcd.database.coreos.com\"],\"resources\":[\"etcdclusters\",\"etcdbackups\",\"etcdrestores\"]}",
          "status": "Satisfied",
          "version": "v1"
        },
        {
          "group": "rbac.authorization.k8s.io",
          "kind": "PolicyRule",
          "message": "namespaced rule:{\"verbs\":[\"*\"],\"apiGroups\":[\"\"],\"resources\":[\"pods\",\"services\",\"endpoints\",\"persistentvolumeclaims\",\"events\"]}",
          "status": "Satisfied",
          "version": "v1"
        },
        {
          "group": "rbac.authorization.k8s.io",
          "kind": "PolicyRule",
          "message": "namespaced rule:{\"verbs\":[\"*\"],\"apiGroups\":[\"apps\"],\"resources\":[\"deployments\"]}",
          "status": "Satisfied",
          "version": "v1"
        },
        {
          "group": "rbac.authorization.k8s.io",
          "kind": "PolicyRule",
          "message": "namespaced rule:{\"verbs\":[\"get\"],\"apiGroups\":[\"\"],\"resources\":[\"secrets\"]}",
          "status": "Satisfied",
          "version": "v1"
        }
      ],
      "group": "",
      "kind": "ServiceAccount",
      "message": "",
      "name": "etcd-operator",
      "status": "Present",
      "version": "v1"
    }
  ]
}
---

Actual results:
only the last condition of csv is in Operator resource

Expected results:
All conditions of csv are in Operator resource.

Additional info:


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