Bug 2058267 - Better to named the oc-mirror version info with more information like the `oc version --client`
Summary: Better to named the oc-mirror version info with more information like the `oc...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.10
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: 4.10.z
Assignee: Alex
QA Contact: RamaKasturi
URL:
Whiteboard:
Depends On: 2056752
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-02-24 15:39 UTC by Vu Dinh
Modified: 2022-03-28 12:03 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-28 12:03:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift oc-mirror pull 334 0 None open Bug 2058267: Add clarifying information to oc-mirror version command and remove alpha.3 from semver 2022-02-24 15:41:55 UTC
Red Hat Product Errata RHBA-2022:1026 0 None None None 2022-03-28 12:03:34 UTC

Description Vu Dinh 2022-02-24 15:39:45 UTC
This bug was initially created as a copy of Bug #2056752

I am copying this bug because: 



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 2 RamaKasturi 2022-03-18 16:52:09 UTC
Verified by extracting oc-mirror from the payload below and i see that version info is being displayed for oc-mirror.

[knarra@knarra test]$ oc get clusterversion
NAME      VERSION                              AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.10.0-0.nightly-2022-03-17-204457   True        False         6h28m   Error while reconciling 4.10.0-0.nightly-2022-03-17-204457: the cluster operator ingress is degraded

Steps followed to verify the bug:
==================================
[knarra@knarra openshift-client-linux-4.9.25]$ RELEASE_IMAGE='registry.ci.openshift.org/ocp/release:4.10.0-0.nightly-2022-03-17-204457'
[knarra@knarra test]$ oc image extract $(oc adm release info $RELEASE_IMAGE  -o=json | jq -r '.references.spec.tags[] | select(.name=="oc-mirror") | .from.name') --path=/usr/bin/oc-mirror:.
W0318 21:43:39.552984   65167 helpers.go:151] Defaulting of registry auth file to "${HOME}/.docker/config.json" is deprecated. The default will be switched to podman config locations in the future version.
W0318 21:43:47.028833   65200 helpers.go:151] Defaulting of registry auth file to "${HOME}/.docker/config.json" is deprecated. The default will be switched to podman config locations in the future version.
[knarra@knarra test]$ ls -l
total 110476
-rw-r-----. 1 knarra knarra 113126160 Mar 18 00:22 oc-mirror
[knarra@knarra test]$ chmod +x oc-mirror 
[knarra@knarra test]$ ./oc-mirror version
Client Version: version.Info{Major:"0", Minor:"1", GitVersion:"v0.1.0", GitCommit:"39506b334d161747ee5018e235f57bdff113bf70", GitTreeState:"clean", BuildDate:"2022-03-17T18:51:12Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

Based on the above moving bug to verified state.

Comment 5 errata-xmlrpc 2022-03-28 12:03:17 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.10.6 bug fix 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/RHBA-2022:1026


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