Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-23055

[OLMv1] the --version of catalogd and operator-controller don't output the right code commit

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • Moderate
    • No
    • None
    • Rejected
    • Flareon OLM Sprint 266, Glaceon OLM Sprint 267, Horsea OLM Sprint 268, Ivysaur OLM Sprint 269, Jigglypuff OLM Sprint 270, Kabuto Sprint 271, Lillipup Sprint 272, Mewtwo Sprint 273, Nidoran Sprint 274
    • 9
    • Done
    • Bug Fix
    • Hide
      * Before this update, the catalogd and Operator Controller components did not display the correct version and commit information when using the {oc-first}. With this update, the correct commit and version information is displayed. (link:https://issues.redhat.com/browse/OCPBUGS-23055[OCPBUGS-23055])
      Show
      * Before this update, the catalogd and Operator Controller components did not display the correct version and commit information when using the {oc-first}. With this update, the correct commit and version information is displayed. (link: https://issues.redhat.com/browse/OCPBUGS-23055 [ OCPBUGS-23055 ])
    • None
    • None
    • None
    • None

      Description of problem:

      For the user, it's important to know which version is used. But from the current version output, I couldn't identify the exact code version I used. The version info does not represent the source code, but the image. 

      MacBook-Pro:~ jianzhang$ oc project
      Using project "openshift-catalogd" on server "https://api.qe-daily-415-1108.qe.devcluster.openshift.com:6443".
      MacBook-Pro:~ jianzhang$ oc get pods 
      NAME                                           READY   STATUS      RESTARTS   AGE
      catalogd-controller-manager-68598bcc99-c8sgc   2/2     Running     0          5h45m
      
      MacBook-Pro:~ jianzhang$ oc exec catalogd-controller-manager-68598bcc99-c8sgc -- ./manager --version
      version.Info{Major:"4", Minor:"15", GitVersion:"v4.15.0-202311032149.p0.gd9fa05d.assembly.stream-dirty", GitCommit:"3a3c6da7f4d2873536fcf29db1b7fcf386718488", GitTreeState:"dirty", BuildDate:"2023-11-03T21:56:36Z", GoVersion:"go1.20.10 X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

       

      Version-Release number of selected component (if applicable):

      4.15.0-0.nightly-2023-11-07-091937

      How reproducible:

      always

      Steps to Reproduce:

      1. Install OCP 4.15
      2. Enable TP
      $ oc patch featuregate cluster -p '{"spec": {"featureSet": "TechPreviewNoUpgrade"}}' --type=merge
      
      3. Check the catalogd's version.
      

      Actual results:

      The version info is incorrect. It doesn't represent the source code.

      MacBook-Pro:~ jianzhang$ oc exec catalogd-controller-manager-68598bcc99-c8sgc -- ./manager --version version.Info{Major:"4", Minor:"15", GitVersion:"v4.15.0-202311032149.p0.gd9fa05d.assembly.stream-dirty", GitCommit:"3a3c6da7f4d2873536fcf29db1b7fcf386718488", GitTreeState:"dirty", BuildDate:"2023-11-03T21:56:36Z", GoVersion:"go1.20.10 X:strictfipsruntime", Compiler:"gc", Platform:"linux/amd64"}

      Expected results:

      The `–version` should output the source code commit ID. Such as "d9fa05d7a2881e7cd93d2f13630dfdcec8f65afd", not the "3a3c6da7f4d2873536fcf29db1b7fcf386718488".

      MacBook-Pro:~ jianzhang$ oc adm release info --commits registry.ci.openshift.org/ocp/release:4.15.0-0.nightly-2023-11-07-091937 |grep catalogd
        olm-catalogd                                   https://github.com/openshift/operator-framework-catalogd                    d9fa05d7a2881e7cd93d2f13630dfdcec8f65afd

      Additional info:

      The version info should refer to the "io.openshift.build.commit.id" instead of the "vcs-ref".

      [cloud-user@preserve-olm-env2 ~]$ podman inspect  quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:a37dea0121d61e63018cf3425fe1bd471a75da327dffed33c435d01b993c154e 
      [
           {
                "Id": "b92b4150678c0a60986193d8253126505dca0452c594a9d9050fb11063bcfcf1",
                "Digest": "sha256:a37dea0121d61e63018cf3425fe1bd471a75da327dffed33c435d01b993c154e",
                "RepoTags": [],
                "RepoDigests": [
                     "quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:a37dea0121d61e63018cf3425fe1bd471a75da327dffed33c435d01b993c154e"
                ],
      ...
      ...
                          "io.k8s.description": "This is a component of OpenShift Container Platform that provides operator catalog support.",
                          "io.k8s.display-name": "OpenShift Operator Lifecycle Manager Catalog Controller",
                          "io.openshift.build.commit.id": "d9fa05d7a2881e7cd93d2f13630dfdcec8f65afd",
                          "io.openshift.build.commit.url": "https://github.com/openshift/operator-framework-catalogd/commit/d9fa05d7a2881e7cd93d2f13630dfdcec8f65afd",
                          "io.openshift.build.source-location": "https://github.com/openshift/operator-framework-catalogd",
                          "io.openshift.expose-services": "",
                          "io.openshift.maintainer.component": "OLM / Registry",
                          "io.openshift.maintainer.project": "OCPBUGS",
                          "io.openshift.tags": "openshift,base",
                          "maintainer": "Red Hat, Inc.",
                          "name": "openshift/ose-olm-catalogd-rhel8",
                          "release": "202311032149.p0.gd9fa05d.assembly.stream",
                          "summary": "Provides the latest release of the Red Hat Extended Life Base Image.",
                          "url": "https://access.redhat.com/containers/#/registry.access.redhat.com/openshift/ose-olm-catalogd-rhel8/images/v4.15.0-202311032149.p0.gd9fa05d.assembly.stream",
                          "vcs-ref": "3a3c6da7f4d2873536fcf29db1b7fcf386718488",
                          "vcs-type": "git",
                          "vendor": "Red Hat, Inc.",
                          "version": "v4.15.0"
      
      

              rh-ee-cchantse Catherine Chan-Tse
              rhn-support-jiazha Jian Zhang
              None
              None
              Jian Zhang Jian Zhang
              None
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: