Bug 1853367 - virtctl does not report authentication errors
Summary: virtctl does not report authentication errors
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: Virtualization
Version: 2.3.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 2.5.0
Assignee: Igor Bezukh
QA Contact: Israel Pinto
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-07-02 13:55 UTC by Lars Kellogg-Stedman
Modified: 2020-07-27 02:41 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-07-27 02:41:51 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Lars Kellogg-Stedman 2020-07-02 13:55:13 UTC
Description of problem:

When virtctl fails due to authentication problems, the error messages presented to the user are misleading.

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

$ rpm -q kubevirt-virtctl
kubevirt-virtctl-0.26.1-15.el8.x86_64

$ virtctl version
Client Version: version.Info{GitVersion:"v0.26.1", GitCommit:"e40ff7965e2aadbf21131626dfa3be85524e3a2c", GitTreeState:"clean", BuildDate:"2020-02-19T16:16:36Z", GoVersion:"go1.12.8", Compiler:"gc", Platform:"linux/amd64"}
the server could not find the requested resource


How reproducible:

Run virtctl commands without credentials configured.


Steps to Reproduce:
1. Run a command that requires credentials, for example:

virtctl image-upload dv larsdv4 --image-path cirros-0.5.1-x86_64-disk.img --size 1G --storage-class hostpath-provisioner --insecure

2. The command fails with:

the server could not find the requested resource (post datavolumes.cdi.kubevirt.io)

Actual results:

the server could not find the requested resource (post datavolumes.cdi.kubevirt.io)


Expected results:

An error message along the lines of "This command requires authentication".

Comment 2 Igor Bezukh 2020-07-21 06:06:55 UTC
I was unable to reproduce the issue. I've reduced the auth token timeout to 30 secs. Running virtctl after 20 secs returned "Unauthorized" string. Same 
for the command mentioned in the reproduction steps.
Lars, can you please elaborate about the way you made the setup unauthenticated?

Comment 3 Lars Kellogg-Stedman 2020-07-27 02:41:51 UTC
Yeah, I think something else was going on. Sorry for the noise.


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