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

Bug 1865808

Summary: Should display the commit info
Product: OpenShift Container Platform Reporter: Jian Zhang <jiazha>
Component: Operator SDKAssignee: Joe Lanford <jlanford>
Status: CLOSED ERRATA QA Contact: Jian Zhang <jiazha>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 4.6CC: aos-bugs, jesusr
Target Milestone: ---Keywords: UpcomingSprint
Target Release: 4.6.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: 2020-10-27 16:23:12 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 Jian Zhang 2020-08-04 08:53:47 UTC
Description of problem:
After compling the binray, there is no commit and kubernetes version info. As follows,
[root@preserve-olm-env operator-sdk]# operator-sdk version
operator-sdk version: "v1.0.0-alpha.2+git", commit: "unknown", kubernetes version: "unknown", go version: "go1.14 linux/amd64", GOOS: "linux", GOARCH: "amd64"

Version-Release number of selected component (if applicable):
operator-sdk master branch: https://github.com/operator-framework/operator-sdk

How reproducible:
always


Steps to Reproduce:
1. Clone the operator-sdk repo.
[root@preserve-olm-env operator-framework]# git clone https://github.com/operator-framework/operator-sdk
Cloning into 'operator-sdk'...
remote: Enumerating objects: 26, done.
remote: Counting objects: 100% (26/26), done.
remote: Compressing objects: 100% (22/22), done.
remote: Total 31304 (delta 1), reused 10 (delta 1), pack-reused 31278
Receiving objects: 100% (31304/31304), 31.67 MiB | 29.92 MiB/s, done.
Resolving deltas: 100% (17738/17738), done.

2. Compile the operator-sdk binary.

[root@preserve-olm-env operator-framework]# cd operator-sdk/
[root@preserve-olm-env operator-sdk]# git branch
* master
[root@preserve-olm-env operator-sdk]# make tidy
[root@preserve-olm-env operator-sdk]# make install

3, Check the version of the operator-sdk.

Actual results:
There is no commit and kubernetes version info.
[root@preserve-olm-env operator-sdk]# operator-sdk version
operator-sdk version: "v1.0.0-alpha.2+git", commit: "unknown", kubernetes version: "unknown", go version: "go1.14 linux/amd64", GOOS: "linux", GOARCH: "amd64"

Expected results:
Should display the git commit and kubernetes version info so that the customer can know the exact verion they use.

Additional info:

Comment 1 Jesus M. Rodriguez 2020-08-04 14:55:30 UTC
Looks like a regression, here is the 0.19 release output:

$ operator-sdk version
operator-sdk version: "v0.19.0-119-g3932b9a9", commit: "3932b9a907a4d20554b8c527584864189c40fe92", kubernetes version: "v1.18.2", go version: "go1.13.11 linux/amd64"

Comment 4 Jian Zhang 2020-08-05 06:00:31 UTC
1, Pull the updates.
[root@preserve-olm-env operator-sdk]# git pull origin master
remote: Enumerating objects: 2, done.
remote: Counting objects: 100% (2/2), done.
remote: Total 3 (delta 2), reused 2 (delta 2), pack-reused 1
Unpacking objects: 100% (3/3), done.
From https://github.com/operator-framework/operator-sdk
 * branch            master     -> FETCH_HEAD
Updating 8e5d03b..ce96b75
Fast-forward
 Makefile | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

2, Build the binary.
[root@preserve-olm-env operator-sdk]# make tidy
[root@preserve-olm-env operator-sdk]# make install

3, Check the `version` ourput.
[root@preserve-olm-env operator-sdk]# operator-sdk version
operator-sdk version: "v1.0.0-alpha.2-4-gce96b75", commit: "ce96b751a9e377e4e138e76356bf2409ac1fc457", kubernetes version: "v1.18.2", go version: "go1.14 linux/amd64", GOOS: "linux", GOARCH: "amd64"

[root@preserve-olm-env operator-sdk]# git log
commit ce96b751a9e377e4e138e76356bf2409ac1fc457
Author: Venkatramanan Srinivasan <vsriniva>
Date:   Tue Aug 4 14:38:50 2020 -0700

    Bug 1865808:  Fixed the Version issue osdk (#3643)
...

LGTM, verify it.

Comment 7 errata-xmlrpc 2020-10-27 16:23:12 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 (OpenShift Container Platform 4.6 GA Images), 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-2020:4196