Bug 2066619
| Summary: | The GitCommit of the `oc-mirror version` is not correct | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | zhou ying <yinzhou> |
| Component: | oc | Assignee: | 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, vdinh |
| Version: | 4.11 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.11.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: | 2022-08-10 10:55:17 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: | |||
Checked with latest payload , the issue has fixed:
RELEASE_IMAGE='registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-04-18-091618'
oc image extract --confirm $(oc adm release info $RELEASE_IMAGE -o=json | jq -r '.references.spec.tags[] | select(.name=="oc-mirror") | .from.name') --path=/usr/bin/oc-mirror:.
./oc-mirror version
Client Version: version.Info{Major:"", Minor:"", GitVersion:"4.11.0-202204132228.p0.g1f3f725.assembly.stream-1f3f725", GitCommit:"1f3f72569ac31ee4bacde46f156a31618b752b9e", GitTreeState:"clean", BuildDate:"2022-04-13T22:49:42Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}
check the commit id from oc-mirror repo, could see the id now :
[root@localhost oc-mirror]# git log |grep 1f3f72569ac31ee4bacde46f156a31618b752b9e
commit 1f3f72569ac31ee4bacde46f156a31618b752b9e
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 |
Description of problem: The GitCommit of the `oc-mirror version` is not correct, it should come from the git repo. Version-Release number of selected component (if applicable): ./oc-mirror version Client Version: version.Info{Major:"0", Minor:"2", GitVersion:"v0.2.0-alpha.1", GitCommit:"3abb4c3fc71a815e6a3f6a90122ef4d51be67392", GitTreeState:"clean", BuildDate:"2022-03-21T21:07:36Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"} How reproducible: always Steps to Reproduce: 1. Extract the oc-mirror from ocp payload: RELEASE_IMAGE='registry.ci.openshift.org/ocp/release:4.11.0-0.nightly-2022-03-22-021803' 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:. 2. Check the oc-mirror version information: Chmod +x oc-mirror; oc-mirror version 3. Download the latest code for the oc-mirror 4. Compare the GitCommit with the code repo log Actual results: 2. Show the oc-mirror info as: ./oc-mirror version Client Version: version.Info{Major:"0", Minor:"2", GitVersion:"v0.2.0-alpha.1", GitCommit:"3abb4c3fc71a815e6a3f6a90122ef4d51be67392", GitTreeState:"clean", BuildDate:"2022-03-21T21:07:36Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"} 4. Can’t find the same commit id for the GitCommit of the oc-mirror version . [root@localhost oc-mirror]# git log |grep 3abb4c3fc71a815e6a3f6a90122ef4d51be67392 Expected results: 4. The GitCommit is important information for the version and it should be a real commit id in the code repository. Additional info: we always could find the commit id for the oc : oc version --client -o yaml clientVersion: buildDate: "2022-03-21T14:22:50Z" compiler: gc gitCommit: e9566ccd9ac83809a304ff0f0af9103749342e42 gitTreeState: clean gitVersion: 4.11.0-202203211330.p0.ge9566cc.assembly.stream-e9566cc goVersion: go1.17.5 major: "" minor: "" platform: linux/amd64 [root@localhost oc]# git log |grep e9566ccd9ac83809a304ff0f0af9103749342e42 commit e9566ccd9ac83809a304ff0f0af9103749342e42