Bug 1994604 - [RFE] - Add a feature to virtctl to print out a message if virtctl is a different version than the server side
Summary: [RFE] - Add a feature to virtctl to print out a message if virtctl is a diffe...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 4.9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: ffossemo
QA Contact: Akriti Gupta
URL:
Whiteboard: Virtctl
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-08-17 14:07 UTC by Kevin Alon Goldblatt
Modified: 2023-09-15 01:38 UTC (History)
5 users (show)

Fixed In Version: hco-bundle-registry-container-v4.11.0-315 virt-operator-container-v4.11.0-55
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-14 19:28:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt pull 7024 0 None open Add an informative message if the client and server virtctl versions are not aligned 2022-01-25 21:18:18 UTC
Red Hat Issue Tracker CNV-13644 0 None None None 2023-09-15 01:38:15 UTC
Red Hat Product Errata RHSA-2022:6526 0 None None None 2022-09-14 19:28:30 UTC

Description Kevin Alon Goldblatt 2021-08-17 14:07:26 UTC
Description of problem:
Add a feature to virtctl to check client and server version alignment and to print an informative message indicating this with the versions displayed in the message

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

How reproducible:


Steps to Reproduce:
1. When running any virtctl command check that the client and server versions are aligned and display an informative message indicating that the client and server versions are not aligned. The versions of both the client and server should be displayed too
2.
3.

Actual results:
No check is done

Expected results:
An informative message should be displayed indicating that the client and server versions are not aligned. The versions of both the client and server should be displayed

Additional info:
An old bug requiring the versions to be aligned exists:
https://bugzilla.redhat.com/show_bug.cgi?id=1647513

Comment 1 sgott 2021-08-17 15:22:56 UTC
This requested information is returned if the user types:

virtctl version

It appears that the request here is to do this check for literally every invocation of any virtctl command? It's not clear to me what the benefit of doing this is. If compatibility issues manifest from a version mismatch, those scenarios are most likely a bug and should be dealt with individually.

I'm of the opinion that formally doing this check in all cases can actually cause confusion. It implies to end users that there's some benefit or requirement for client and server versions to match, and that's simply not the case.

Can you please clarify why this would be helpful? Does the "virtctl version" subcommand meet your needs? e.g. for the instances where you need to actually verify what versions are in use?

Comment 2 Fabian Deutsch 2021-08-18 08:30:01 UTC
I've requested to file the rfe.

In the past we had bugs where outdated virtctl versions lead to bugs (iirc when we were changing the way how the serial console was done).
There are other cases where virtctl is gaining new features.

Thus a common pattern that is seen - i.e. in minikube and crc - is to compare the client version to the server version, and in case of a newer server version there is a small notice that (likely) there is also a new client version available.
So, this is not about running "virtctl version" on every "virtctl" invocation, but letting the users know when they should be updating virtctl to avoid problems.

Does this help?

Comment 3 sgott 2021-08-23 18:34:56 UTC
If this check shouldn't necessarily be done on every command invocation, could you please clarify when you think that this check should be done?

Comment 4 Fabian Deutsch 2021-08-23 19:02:52 UTC
What approach do other tools in the kube verse take here?

Comment 5 Fabian Deutsch 2022-04-06 07:35:07 UTC
How often?
Upon errors!
Once a day?

Comment 6 ffossemo 2022-04-06 07:45:17 UTC
Currently it will shows the warning message only if an error occurs with the command. Basically, the logic is: if an error occurs executing the command we check the server and client versions; if they don't are compatible (checking only major and minor version, skipping patch version) the command line shows the warning suggesting that (maybe) the problem is related to incompatible versions.

Comment 8 Akriti Gupta 2022-05-16 13:45:10 UTC
checked with v4.11.0-339

no message is displayed on version missmatch

[akrgupta@ovpn-9-60 auth]$ virtctl44 version
Client Version: version.Info{GitVersion:"v0.44.0", GitCommit:"46411f3bb6568c14b23f53b4c5f7e54a63aec2a0", GitTreeState:"clean", BuildDate:"2021-08-09T14:30:18Z", GoVersion:"go1.16.6", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{GitVersion:"v0.53.0-55-ga3aaf1ace", GitCommit:"a3aaf1ace40c44c9dafaf2c091851d5cdb829fd7", GitTreeState:"clean", BuildDate:"2022-05-11T17:53:40Z", GoVersion:"go1.17.5", Compiler:"gc", Platform:"linux/amd64"}

Comment 9 ffossemo 2022-05-17 05:30:18 UTC
In order to avoid too aggressive messages (warning for every interaction), the version mismatch will be shown only if an error occurs with the command you run.

Comment 10 Akriti Gupta 2022-06-23 08:07:40 UTC
Verified with  v4.11.0-339

[akrgupta@fedora bin]$ virtctl55 start vm1
You are using a client virtctl version that is different from the KubeVirt version running in the cluster
Client Version: v0.52.0
Server Version: v0.53.0-55-ga3aaf1ace
Error starting VirtualMachine virtualmachine.kubevirt.io "vm1" not found

Comment 12 errata-xmlrpc 2022-09-14 19:28:21 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 Virtualization 4.11.0 Images security and 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/RHSA-2022:6526

Comment 13 Red Hat Bugzilla 2023-09-15 01:35:32 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 365 days


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