Bug 1878670

Summary: [CNV-2.5] virtctl version returns GitVersion:"v0.0.0-master+$Format:%h$"
Product: Container Native Virtualization (CNV) Reporter: Lukas Bednar <lbednar>
Component: VirtualizationAssignee: Daniel Belenky <dbelenky>
Status: CLOSED ERRATA QA Contact: Israel Pinto <ipinto>
Severity: high Docs Contact:
Priority: high    
Version: 2.5.0CC: cnv-qe-bugs, lbednar, ncredi, sgott
Target Milestone: ---   
Target Release: 2.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: kubevirt-virtctl-2.5.0-59 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-17 13:24:22 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:
Attachments:
Description Flags
Patch to disalbe Go modules at build time none

Description Lukas Bednar 2020-09-14 10:23:10 UTC
Description of problem:

[cloud-user@ocp-psi-executor ~]$ virtctl version
Client Version: version.Info{GitVersion:"v0.0.0-master+$Format:%h$", GitCommit:"$Format:%H$", GitTreeState:"", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{GitVersion:"v0.0.0-master+$Format:%h$", GitCommit:"$Format:%H$", GitTreeState:"", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}


Version-Release number of selected component (if applicable):
[cloud-user@ocp-psi-executor ~]$ rpm -qf `which virtctl`
kubevirt-virtctl-2.5.0-49.el8.x86_64
ocp 4.6.0-fc.4
cnv v2.5.0-163


How reproducible: 100


Steps to Reproduce:
1. Install cnv-2.5
2. run virtctl version
3.

Actual results: getting "v0.0.0-master+$Format:%h$"


Expected results: actual version of deployed cnv


Additional info:

Comment 1 Daniel Belenky 2020-09-24 07:05:10 UTC
Created attachment 1716211 [details]
Patch to disalbe Go modules at build time

Comment 2 Daniel Belenky 2020-09-24 07:06:49 UTC
The root of this issue is a change that we did upstream to use Go modules in a vendoring mode.
This caused ldflags to be rendered to the wrong path.

Output of scratch build of my patch:
❯ ./virtctl version                     
Client Version: version.Info{GitVersion:"v0.33.0-rc.0-134-g5723e09", GitCommit:"5723e0941cb7eae56c868f8d4ca50b99f209f6f9", GitTreeState:"clean", BuildDate:"2020-09-24T06:54:39Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
the server could not find the requested resource

Comment 3 Lukas Bednar 2020-10-01 08:29:39 UTC
[cnv-qe-jenkins@kvirt-night46-zlj5h-executor ~]$ rpm -qa kubevirt-virtctl
kubevirt-virtctl-2.5.0-59.el7.x86_64

[cnv-qe-jenkins@kvirt-night46-zlj5h-executor ~]$ virtctl version
Client Version: version.Info{GitVersion:"v0.33.0-rc.0-347-g7551867", GitCommit:"75518673376fd5d62f72d5ff41bc55efa239bd96", GitTreeState:"clean", BuildDate:"2020-09-30T20:14:09Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{GitVersion:"v0.33.0-rc.0-134-g5723e09", GitCommit:"5723e0941cb7eae56c868f8d4ca50b99f209f6f9", GitTreeState:"clean", BuildDate:"2020-09-24T07:14:57Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

Verified.

Comment 6 errata-xmlrpc 2020-11-17 13:24:22 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 Virtualization 2.5.0 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/RHEA-2020:5127