Bug 2056752

Summary: Better to named the oc-mirror version info with more information like the `oc version --client`
Product: OpenShift Container Platform Reporter: zhou ying <yinzhou>
Component: ocAssignee: Alex <aflom>
oc sub component: oc-mirror QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, jpower, knarra, mfojtik, vdinh
Version: 4.10   
Target Milestone: ---   
Target Release: 4.11.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-08-10 10:50:27 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:
Bug Depends On:    
Bug Blocks: 2058267    

Description zhou ying 2022-02-22 02:47:24 UTC
Description of problem:
Better to named the oc-mirror version info with more information like the `oc version --client` :

oc-mirror version 
v0.1.0-alpha.3


for example:
oc version --client
Client Version: 4.10.0-202202112036.p0.g50ff55b.assembly.stream-50ff55b

Version-Release number of selected component (if applicable):
oc-mirror version 
v0.1.0-alpha.3

How reproducible:
always

Steps to Reproduce:
1. extract the oc-mirror from ocp4.10 payload:
`container_id=$(podman create quay.io/openshift-release-dev/ocp-v4.0-art-dev@sha256:17a0307955f8740801280aeaf155637432b0742c5d873b2ee6072594a2a650dd)`
`podman export ${container_id} > temp.tar`
`tar xvf temp.tar usr/bin/oc-mirror --strip-components=2`
2. check the oc-mirror info

Actual results:
2. The version information is meaningless。
oc-mirror version 
v0.1.0-alpha.3

Expected results:
2. Please refer the oc version information , like the build date or git id . 
oc version --client
Client Version: 4.10.0-202202112036.p0.g50ff55b.assembly.stream-50ff55b

Additional info:

Comment 1 RamaKasturi 2022-02-22 13:43:54 UTC
AFAIK, i do not think we should have the version as at least "alpah.3" when we are doing a tech preview release of the oc-mirror.

Comment 2 Jennifer Power 2022-02-22 14:49:45 UTC
@knarra we have a pull request (https://github.com/openshift/oc-mirror/pull/334) to address this issue where we have added the commit and build date information. We removed alpha.3 from the server and just versioned it as v0.1.0. Are there any versioning requirements that you are aware of for a tech preview release that we are missing? Thanks!

Comment 3 Vu Dinh 2022-02-22 15:40:10 UTC
The issue is fixed on main (4.11). We will clone this BZ to 4.10 after QE verifies the fix on 4.11.

Thanks.

Comment 4 RamaKasturi 2022-02-22 16:46:02 UTC
(In reply to Jennifer Power from comment #2)
> @knarra we have a pull request
> (https://github.com/openshift/oc-mirror/pull/334) to address this issue
> where we have added the commit and build date information. We removed
> alpha.3 from the server and just versioned it as v0.1.0. Are there any
> versioning requirements that you are aware of for a tech preview release
> that we are missing? Thanks!

Hello Jenn, 

   I think having it as what yinzhou describec in the expected results should be good.

Thanks
kasturi

Comment 6 zhou ying 2022-02-23 06:01:38 UTC
Checked with the code , I could see more information about the version :

./bin/oc-mirror  version 
Client Version: version.Info{Major:"0", Minor:"1", GitVersion:"v0.1.0", GitCommit:"38f4dc72ccfc071ac1cd2ec643ef7fa65b9cafef", GitTreeState:"clean", BuildDate:"2022-02-23T05:51:46Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"}

Comment 7 Vu Dinh 2022-02-23 15:45:10 UTC
Can you move this BZ to VERIFIED?

Thanks,
Vu

Comment 8 RamaKasturi 2022-02-23 18:30:46 UTC
@vuDinh, yinzhou has done per-merge verification on this bug, so once the bug is moved to ON_QA it will be moved to verified automatically by cluster-bot. If not as well, QE needs the bug to be in ON_QA state for us to be able to move it to verified. A bug cannot directly go from POST to VERIFIED. Thanks !!

Comment 9 Vu Dinh 2022-02-23 19:51:25 UTC
This BZ for 4.11 as in main/release-4.11 branch. Here is the PR for main (4.11): https://github.com/openshift/oc-mirror/pull/328 (merged).

So I would like to verify this for 4.11 and then I can clone this BZ to 4.10 and tag it against the current pending 4.10 PR.

Thanks,
Vu

Comment 10 zhou ying 2022-02-24 06:12:37 UTC
checked with the code and the main branch has the correct version info:

./bin/oc-mirror version 
Client Version: version.Info{Major:"0", Minor:"2", GitVersion:"v0.2.0-alpha.1", GitCommit:"f9ddff31a6a4bcd6db999190c618c67f1efb301b", GitTreeState:"clean", BuildDate:"2022-02-24T06:08:25Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"linux/amd64"}

Comment 11 errata-xmlrpc 2022-08-10 10:50:27 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 (Important: OpenShift Container Platform 4.11.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-2022:5069