New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preserve path for cluster server endpoints (fixes virtctl with Rancher) #7361
Conversation
Hi @SeanKnight. Thanks for your PR. I'm waiting for a kubevirt member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
u.Path = path.Join( | ||
u.Path, | ||
fmt.Sprintf("/apis/subresources.kubevirt.io/%s/namespaces/%s/%s/%s/%s", v1.ApiStorageVersion, namespace, resource, name, subresource), | ||
) | ||
u.Path = fmt.Sprintf("/apis/subresources.kubevirt.io/%s/namespaces/%s/%s/%s/%s", v1.ApiStorageVersion, namespace, resource, name, subresource) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line would need to be removed otherwise it will overwite u.Path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much, it slipped back in there when I was typing up the PR and wanted to get the variable value. I have fixed it.
d6dba21
to
8fc8f3a
Compare
/ok-to-test |
/retest |
1 similar comment
/retest |
47034d1
to
a0513b3
Compare
/retest |
I undid my changes (as a new commit) and force pushed, and the same test failed (and now an additional one), so I do not believe my commit is what is causing these tests to fail. |
a0513b3
to
8fc8f3a
Compare
@dankenigsberg is it possible that the pull-kubevirt-e2e-k8s-1.23-sig-compute-cgroupsv2 failure could be caused by ca2686a#diff-005747350099de38fcd22401693fe634b2c4607b4deec581b298efe440b93d2fR154 ? That is the most recent change I see on the test that is failing. |
Signed-off-by: Sean Knight <git@seanknight.com>
8fc8f3a
to
4cd6269
Compare
Rebased from origin/main in case recent commits fixed something. |
The failure in https://prow.ci.kubevirt.io/view/gs/kubevirt-prow/pr-logs/pull/kubevirt_kubevirt/7361/pull-kubevirt-e2e-k8s-1.23-sig-compute-cgroupsv2/1503304370333159424#1:build-log.txt%3A3038 seems about the kubevirtci cluster not responding fast enough; it seem unrelated to my recent changes. Unfortunately, it is not uncommon for a single test of ours to fail due to a fluke timeout. My PR #7251 is a small step towards simplifying and normalizing our tests. I hope more people join this cleanup effort, which should eventually make our tests more reliable and easier to debug. |
The CI failure does not seem related to the changes here. Probably just some flaky tests. From my perspective the PR looks fine. @rmohr , maybe you could take a look as well? /lgtm |
Yes everything looks great. We had temporary issues due to a github issue and, and a public golang proxy going down. The job backlog is causing a little bit more pressure on CI than it should. @SeanKnight I love that PR! The fix is so simple. This issue was bugging us for a really long time. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rmohr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@dankenigsberg thank you for taking a look, I could not for the life of me figure out what was going on. @vasiliy-ul @rmohr thank you too for taking a look at this. /retest 🤞 |
/retest |
1 similar comment
/retest |
/retest |
@SeanKnight I know our merge experience for new contributors is not optimal, but you can just leave it as is. Our bot will take care of the retests (but you are welcome to write retest yourself if you like). |
@rmohr thank you I will let the bot take care of it. |
/retest |
What this PR does / why we need it:
This PR fixes
virtctl
so that it can be used with clusters accessed via Rancher's authentication proxy.Here is an example kubeconfig to illustrate the problem:
As you can see, the URL for the
rancher-managed-cluster
contains a path component, which is valid, but uncommon so one might assume that they are never present if they have not encountered it before.I ran
virtctl console myvmi
with a debugger until I found where the path component was being discarded:kubevirt/staging/src/kubevirt.io/client-go/kubecli/vmi.go
Line 150 in a424098
Before the above line is executed, the value of u.Path was:
After the line was executed the observed value was:
The correct value that should be expected is:
The result is that the API request ends up going to the
rancher-server
cluster instead ofrancher-managed-cluster
, which results in very confusing error messages since it was not obvious that the wrong cluster was responding.The proposed code change appends to the
u.Path
value instead of replacing it.Which issue(s) this PR fixes:
Fixes #3760, Fixes #2608
Special notes for your reviewer:
Tested with my cluster accessed through Rancher, and tests in
vmi_test.go
passed, but no other testing was performed.Release note: