-
Notifications
You must be signed in to change notification settings - Fork 33
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
Watch request fails with InvalidOperationException #163
Comments
Good catch! Thanks, I’ll get that fixed tomorrow 🙂 |
@kick2nick - if I can get new packages published to our development package feed, would you be able to verify whether they resolve the issue for you? |
Yes, I would be able |
Can you try v2.5.11-develop.5? |
Got this 😄 : |
Ok, that’s odd - I thought I’d tested it pretty thoroughly but perhaps the behaviour is different in PowerShell 🤷🏻 I’ll write up some unit tests and see what’s going on ( |
Ugh, it is different in PowerShell (where I did my testing). Needs to be |
The BCL’s handling of relative URIs is pretty broken. #163
I’ll add some tests once I get to my computer; it seems there are a couple of unexpected quirks in the BCL’s handling of relative URIs 🙂 |
Ok, can you try v2.5.11-develop.7? There are a bunch of tests, now, for URI handling, so I'm pretty confident it should work correctly now (I'd integration-test this myself, but I don't have a working k8s cluster at the moment!). |
Tested in k8s new version, watch request works as expected. |
I’ll see what I can do about expanding the route parameters, but it may require an enhancement to the HTTP template library :) |
It's your choice, but as far as I understand this bug impacts all watch requests in your library, so this enhancement could be part of separate PR if it need time. |
Definitely agree; will leave that for later, but can at least make the logging conditional on the configured log level. Will publish a release version tomorrow morning. |
Cool, thank you for quick fix! |
BTW, I will probably remove that log statement (eventually) as KubeClient’s existing request/response logging will already include that populated URI. |
Publishing v2.5.12... |
Good catch! Done 🙂 |
There is a log call introduced in 8cda77d that uses PathAndQuery property of created request.
dotnet-kube-client/src/KubeClient/ResourceClients/KubeResourceClient.cs
Lines 596 to 598 in 1e08492
But HttpRequest created by factory is relative URI, so on attempts to call ObserveLines I'm getting exception in Observable OnError:
Unexpected error while streaming from the Kubernetes API to \"watch v1/Endpoints 'some-service' in namespace dev\".","exceptions":["System.InvalidOperationException: This operation is not supported for a relative URI."," at System.Uri.get_PathAndQuery()"," at KubeClient.ResourceClients.KubeResourceClient.<>c__DisplayClass30_0.<<ObserveLines>b__0>d.MoveNext()
The text was updated successfully, but these errors were encountered: