Bug 1865808 - Should display the commit info
Summary: Should display the commit info
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Operator SDK
Version: 4.6
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.6.0
Assignee: Joe Lanford
QA Contact: Jian Zhang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-04 08:53 UTC by Jian Zhang
Modified: 2020-10-27 16:23 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 16:23:12 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github operator-framework operator-sdk pull 3643 0 None closed Bug 1865808: Version informations populating error fix 2021-01-14 07:51:49 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:23:29 UTC

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@redhat.com>
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


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