Bug 1660888 - virtctl image-upload fails when a trailing slash is added to the upload proxy URL
Summary: virtctl image-upload fails when a trailing slash is added to the upload proxy...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Container Native Virtualization (CNV)
Classification: Red Hat
Component: User Experience
Version: 1.3
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 2.0
Assignee: Anna Stopel
QA Contact: Guohua Ouyang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-19 14:23 UTC by Sergi Jimenez Romero
Modified: 2019-07-24 20:15 UTC (History)
9 users (show)

Fixed In Version: kubevirt-0.17.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-07-24 20:15:50 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github kubevirt kubevirt issues 1863 0 None None None 2018-12-19 14:24:49 UTC
Red Hat Product Errata RHEA-2019:1850 0 None None None 2019-07-24 20:15:59 UTC

Description Sergi Jimenez Romero 2018-12-19 14:23:45 UTC
Description of problem:

There are two different scenarios where virtctl image-upload would fail, and it shouldn't:

#1

$ virtctl image-upload --uploadproxy-url=https://cdi-uploadproxy-kube-system.apps.10.19.138.91.nip.io/ --pvc-name=upload-fedora-pvc4 --pvc-size=5Gi --image-path=tmp/Fedora-Cloud-Base-29-1.2.x86_64.qcow2 --insecure

Unexpected return value 500                                                                          

#2

$ virtctl image-upload --uploadproxy-url=https://cdi-uploadproxy-kube-system.apps.10.19.138.91.nip.io/v1alpha1/upload --pvc-name=upload-fedora-pvc2 --pvc-size=5Gi --image-path=tmp/Fedora-Cloud-Base-29-1.2.x86_64.qcow2 --insecure

Unexpected return value 404         

First one fails because of the trailing slash while the second one fails cause the code unconditionally adds '/v1alpha1/upload' the URL specified on the CLI.                                                                                                                                                                                                                                                                                                                                                                                                                                                           

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

Client Version: version.Info{GitVersion:"v0.9.6", GitCommit:"4badea07eb02458d4c64395f234fd2b77d74057e", GitTreeState:"clean", BuildDate:"2018-11-26T13:36:46Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{GitVersion:"v1.3.0-13-2-g377460b", GitCommit:"4badea07eb02458d4c64395f234fd2b77d74057e", GitTreeState:"clean", BuildDate:"2018-11-26T14:36:46Z", GoVersion:"go1.9.4", Compiler:"gc", Platform:"linux/amd64"}


How reproducible:

Always

Steps to Reproduce:

1. Follow the steps above.

Actual results:

Error 500 or 404

Expected results:

For the URL to be sanitized.


Additional info:

Comment 1 Sergi Jimenez Romero 2018-12-19 14:25:18 UTC
Possible fix: https://github.com/kubevirt/kubevirt/pull/1864

Comment 2 Sergi Jimenez Romero 2019-01-09 08:58:14 UTC
PR 1864 was closed in favor of https://github.com/kubevirt/kubevirt/pull/1876

Comment 3 Adam Litke 2019-01-22 14:07:23 UTC
Anna, please take this bug.  We should add a fix to virtctl to remove trailing slashes and then backport that to the stable release branch for 1.4.

Comment 4 Anna Stopel 2019-01-29 10:52:37 UTC
The fix is in PR https://github.com/kubevirt/kubevirt/pull/1981
Currentky wiating for PR to be merged, then will proceed with backporting

Comment 5 Adam Litke 2019-02-05 13:11:13 UTC
Hi Anna, Any updates on when this will be merged?

Comment 6 Anna Stopel 2019-02-05 14:10:27 UTC
Hi, I am implementing unit test for the fix, as requested in the PR. Hopefully will deliver that tomorrow

Comment 7 Federico Simoncelli 2019-02-11 09:47:23 UTC
(In reply to Anna Stopel from comment #6)
> Hi, I am implementing unit test for the fix, as requested in the PR.
> Hopefully will deliver that tomorrow

What is the status? As reminder, this is targeted for 1.4.

Comment 8 Federico Simoncelli 2019-02-11 13:20:19 UTC
Adam can you file a documentation bug for 1.4.

Comment 9 Adam Litke 2019-02-11 20:11:09 UTC
Created doc bug here: https://bugzilla.redhat.com/show_bug.cgi?id=1674505

Comment 10 Anna Stopel 2019-02-14 14:20:25 UTC
fixed and merged in https://github.com/kubevirt/kubevirt/pull/1981

Comment 11 Tomas Jelinek 2019-05-14 07:28:37 UTC
@Anna, if already in some build, can you please move it to on_qa and set the appropriate "Fixed In Version"? Thank you!

Comment 12 Tomas Jelinek 2019-05-16 12:36:06 UTC
@Adam, can this be moved to on_qa?

Comment 15 errata-xmlrpc 2019-07-24 20:15:50 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/RHEA-2019:1850


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