Bug 1932139 - The downstream darwin/amd64 `opm` binary fails to output the version info
Summary: The downstream darwin/amd64 `opm` binary fails to output the version info
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.9.0
Assignee: tflannag
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-24 03:55 UTC by Jian Zhang
Modified: 2021-10-18 17:29 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-10-18 17:29:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift operator-framework-olm pull 157 0 None None None 2021-08-04 20:42:28 UTC
Red Hat Product Errata RHSA-2021:3759 0 None None None 2021-10-18 17:29:39 UTC

Description Jian Zhang 2021-02-24 03:55:00 UTC
Description of problem:
The `opm` binary get from the tar fails to output the version info.
mac:opm jianzhang$ ./darwin-amd64-opm version
Version: version.Version{OpmVersion:"unknown", GitCommit:"", BuildDate:"", GoOs:"darwin", GoArch:"amd64"}

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

How reproducible:
always

Steps to Reproduce:
1. Get the opm tar from https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/

2. unzip it.
mac:opm jianzhang$ tar -zxvf  opm-mac.tar.gz
x darwin-amd64-opm

3. check the version info.
mac:opm jianzhang$ ./darwin-amd64-opm version
Version: version.Version{OpmVersion:"unknown", GitCommit:"", BuildDate:"", GoOs:"darwin", GoArch:"amd64"}

Actual results:
No version info.
mac:opm jianzhang$ ./darwin-amd64-opm version
Version: version.Version{OpmVersion:"unknown", GitCommit:"", BuildDate:"", GoOs:"darwin", GoArch:"amd64"}

Expected results:
It should be like:
[root@preserve-olm-env data]# opm version
Version: version.Version{OpmVersion:"v1.14.3-94-g6183dbb", GitCommit:"6183dbb", BuildDate:"2021-02-04T09:33:47Z", GoOs:"linux", GoArch:"amd64"}


Additional info:

Comment 1 Ben Luddy 2021-02-24 22:01:08 UTC
The 4.6.19 and 4.7.0 x86_84/linux opm binaries look OK. The cross-compilation Makefile recipes pass --ldflags twice (and the second one does not contain the link-time variables to set), so I suspect the last --ldflags wins.

https://github.com/operator-framework/operator-registry/blob/master/Makefile#L31-L37

Comment 3 Ben Luddy 2021-02-24 22:06:04 UTC
The windows binaries are probably affected too.

Comment 8 Jian Zhang 2021-08-25 01:09:13 UTC
I couldn't get the latest opm from the https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest/, only 4.8.5 version there, so I get it from the image and have a try. It looks good, as follows, but this opm is not for the Mac.

[cloud-user@preserve-olm-env jian]$ podman pull registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-operator-registry:v4.9
Trying to pull registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-operator-registry:v4.9...
Getting image source signatures
Copying blob 356f18f3a935 skipped: already exists  
Copying blob 296e14ee2414 skipped: already exists  
Copying blob 0205529b95f0 done  
Copying blob 077ef25c1a9d done  
Copying blob 1e7e9b5e7bd9 done  
Copying config 5018ef3875 done  
Writing manifest to image destination
Storing signatures
5018ef387543f3688a16b535236ce958fad5e30ddfea92e73d9c7a5f84775836
[cloud-user@preserve-olm-env jian]$ podman create --name opm registry-proxy.engineering.redhat.com/rh-osbs/openshift-ose-operator-registry:v4.9 
afc65eddc03135c4f59d13923fc8a8990e5bef85533b7455a5491f960b4ec893
[cloud-user@preserve-olm-env jian]$ podman cp opm:/bin/opm .
[cloud-user@preserve-olm-env jian]$ ./opm version
Version: version.Version{OpmVersion:"6ee2f331d", GitCommit:"6ee2f331d69674714ed23e3264f7d5db784fb83e", BuildDate:"2021-08-24T17:48:38Z", GoOs:"linux", GoArch:"amd64"}

@Ben Do you happen to know where can I get the latest opm for the Mac? Thanks!

Comment 11 Jian Zhang 2021-08-26 01:53:45 UTC
Thanks Tim!

I get it from the https://mirror.openshift.com/pub/openshift-v4/clients/ocp-dev-preview/4.9.0-0.nightly-2021-08-25-093627/, details:

[cloud-user@preserve-olm-env jian]$ wget https://mirror.openshift.com/pub/openshift-v4/clients/ocp-dev-preview/4.9.0-0.nightly-2021-08-25-093627/opm-mac.tar.gz
mac:opm jianzhang$ tar -zxvf opm-mac.tar.gz 
x darwin-amd64-opm
mac:opm jianzhang$ ./darwin-amd64-opm version
Version: version.Version{OpmVersion:"0178564d0", GitCommit:"0178564d0b6aa035e4daedcb0da94be75c20b90a", BuildDate:"2021-08-25T01:40:56Z", GoOs:"darwin", GoArch:"amd64"}

commit: "0178564d0b6aa035e4daedcb0da94be75c20b90a" in https://github.com/openshift/operator-framework-olm/commits/master
The version info looks good, verify it.

Comment 14 errata-xmlrpc 2021-10-18 17:29:20 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 (Moderate: OpenShift Container Platform 4.9.0 bug fix and security 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-2021:3759


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