Bug 1832769 - [kubevirt version] is not reported correctly
Summary: [kubevirt version] is not reported correctly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 2.4.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 2.4.0
Assignee: Daniel Belenky
QA Contact: zhe peng
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-05-07 09:25 UTC by Tareq Alayan
Modified: 2020-07-28 19:10 UTC (History)
3 users (show)

Fixed In Version: hco-bundle-registry-container-v2.3.0-299
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-28 19:10:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
disable GO111MODULE during the build (49 bytes, patch)
2020-05-21 13:14 UTC, Daniel Belenky
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2020:3194 0 None None None 2020-07-28 19:10:21 UTC

Description Tareq Alayan 2020-05-07 09:25:30 UTC
Description of problem:
kubevirt doesn't report its git commit or version

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
kubectl proxy >/dev/null &
curl -sS http://127.0.0.1:8001/apis/subresources.kubevirt.io
{
  "kind": "APIGroup",
  "apiVersion": "v1",
  "name": "subresources.kubevirt.io",
  "versions": [
    {
      "groupVersion": "subresources.kubevirt.io/v1alpha3",
      "version": "v1alpha3"
    }
  ],
  "preferredVersion": {
    "groupVersion": "subresources.kubevirt.io/v1alpha3",
    "version": "v1alpha3"
  }
}

we take the version v1alpha3
and then:
curl -sS http://127.0.0.1:8001/apis/subresources.kubevirt.io/v1alpha3/version
{
 "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"
}
fg
ctrl-c


Expected results:

{
 "gitVersion": "v0.26.1",
 "gitCommit": "e40ff7965e2aadbf21131626dfa3be85524e3a2c",
 "gitTreeState": "clean",
 "buildDate": "2020-03-31T16:26:36Z",
 "goVersion": "go1.12.12",
 "compiler": "gc",
 "platform": "linux/amd64"
}



Additional info:

Comment 1 Tareq Alayan 2020-05-07 09:26:45 UTC
(In reply to Tareq Alayan from comment #0)
> Description of problem:
> kubevirt doesn't report its git commit or version
> 
> Version-Release number of selected component (if applicable):
 HCO image: registry-proxy.engineering.redhat.com/rh-osbs/container-native-virtualization-hyperconverged-cluster-operator@sha256:79b15a603fe6527df83dd53033410bedc54bb19c22f7853f770fbbf62008f024
CSV creation time: 2020-05-06 21:08:08
> 
> 
> How reproducible:
> always
> 
> Steps to Reproduce:
> kubectl proxy >/dev/null &
> curl -sS http://127.0.0.1:8001/apis/subresources.kubevirt.io
> {
>   "kind": "APIGroup",
>   "apiVersion": "v1",
>   "name": "subresources.kubevirt.io",
>   "versions": [
>     {
>       "groupVersion": "subresources.kubevirt.io/v1alpha3",
>       "version": "v1alpha3"
>     }
>   ],
>   "preferredVersion": {
>     "groupVersion": "subresources.kubevirt.io/v1alpha3",
>     "version": "v1alpha3"
>   }
> }
> 
> we take the version v1alpha3
> and then:
> curl -sS http://127.0.0.1:8001/apis/subresources.kubevirt.io/v1alpha3/version
> {
>  "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"
> }
> fg
> ctrl-c
> 
> 
> Expected results:
> 
> {
>  "gitVersion": "v0.26.1",
>  "gitCommit": "e40ff7965e2aadbf21131626dfa3be85524e3a2c",
>  "gitTreeState": "clean",
>  "buildDate": "2020-03-31T16:26:36Z",
>  "goVersion": "go1.12.12",
>  "compiler": "gc",
>  "platform": "linux/amd64"
> }
> 
> 
> 
> Additional info:

Comment 2 Daniel Belenky 2020-05-21 13:13:00 UTC
The root cause for this bug is that we are now using Go 1.13
and it uses go modules to for to compile the sources unless
we explicitly set GO111MODULE to 'off'.

A fix that disables GO111MODULE:
https://code.engineering.redhat.com/gerrit/#/c/201060/1

Currently there is an outage in Brew so we can't get new builds.

Comment 3 Daniel Belenky 2020-05-21 13:14:17 UTC
Created attachment 1690641 [details]
disable GO111MODULE during the build

Comment 4 Daniel Belenky 2020-05-21 14:25:46 UTC
Verified that with a scratch build we get the values as expected:

[root@7b05b5f26f48 /]# virtctl version
Client Version: version.Info{GitVersion:"v0.29.1", GitCommit:"3452204c267b9c29492e2afc3c18761ee42a17e6", GitTreeState:"clean", BuildDate:"2020-05-21T13:20:50Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}


I merged the patch, let's wait for official build and verification from QE.
Moving the bug to MODIFIED.

Comment 5 zhe peng 2020-06-15 03:04:47 UTC
verify with build:
$ virtctl version
Client Version: version.Info{GitVersion:"v0.26.1", GitCommit:"e40ff7965e2aadbf21131626dfa3be85524e3a2c", GitTreeState:"clean", BuildDate:"2020-02-19T16:13:09Z", GoVersion:"go1.11.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{GitVersion:"v0.30.0", GitCommit:"736b4aec6b2e92f2ab09ccfa6c5eb79366e88e5a", GitTreeState:"clean", BuildDate:"2020-06-08T21:28:27Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}

sh-4.2# kubectl proxy >/dev/null & curl -sS http://127.0.0.1:8001/apis/subresources.kubevirt.io
[2] 2066654
{
  "kind": "APIGroup",
  "apiVersion": "v1",
  "name": "subresources.kubevirt.io",
  "versions": [
    {
      "groupVersion": "subresources.kubevirt.io/v1alpha3",
      "version": "v1alpha3"
    }
  ],
  "preferredVersion": {
    "groupVersion": "subresources.kubevirt.io/v1alpha3",
    "version": "v1alpha3"
  }
}

sh-4.2# curl -sS http://127.0.0.1:8001/apis/subresources.kubevirt.io/v1alpha3/version
{
 "gitVersion": "v0.30.0",
 "gitCommit": "736b4aec6b2e92f2ab09ccfa6c5eb79366e88e5a",
 "gitTreeState": "clean",
 "buildDate": "2020-06-08T21:28:27Z",
 "goVersion": "go1.13.4",
 "compiler": "gc",
 "platform": "linux/amd64"
}

move to verified.

Comment 8 errata-xmlrpc 2020-07-28 19:10:05 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, 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-2020:3194


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