Pod exec broken since 0.22.0
b-t-927 opened this issue · 6 comments
The exec function for pod repositories has been broken since version 0.22.0, instead of command output you get:
[
"kind" => "Status",
"apiVersion" => "v1",
"metadata" => [],
"status" => "Failure",
"message" => "Upgrade request required",
"reason" => "BadRequest",
"code" => 400,
]
From what I can see the issue seems to be in Client.php, it seems like it's waiting for a HttpTransferException to be thrown before running the function to upgrade the request, but for whatever reason the exception isn't being thrown.
Indeed this is where it all begins, moving error 400 outside the exception and into the try{}, gives a ratched/pawl issue, as the current version of maclof client uses old 0.3 ratchet, it fails further down the line. Not sure if this project is stale?
@danijelk not stale, just havn't been able to work on it much recently
I'll try and take a look at all issues as soon as I can :)
@danijelk not stale, just havn't been able to work on it much recently I'll try and take a look at all issues as soon as I can :)
Great to hear, will try to help as much as I can, debugging ws isn't my strength.
Progress so far:
- Adding ^0.4 for ratchet was no biggie,
- Moving isUpgradeRequestRequired into try{} block
- Fixing $fullUrl, which basically is $requestUri here (or does the parseQueryParams result more proper for wss url vs http_build_query?)
- reverse order of https://github.com/maclof/kubernetes-client/blob/master/src/Client.php#L496 as per source ($socketOptions, $loop)
Currently trying to figure out why I cannot see any $messages from the wss connection made here, not sure if it's a fw issue towards aws k8s or something else.
This was kind of a pain to get working in the first instance, so honestly i'm not surprised
Appreciate the help though :)
Eek, so yea the new smart $httpClient where the verify = false is set, is no longer available in Client.php making the code obsolete will see what the best workaround would be since we cannot access the httpClients options as I see it
Works! Time to get some sleep :)
https://github.com/vemcogroup/kubernetes-client/compare/0.26.0...0.26.1
So the issue was that now we use the httpClient, but this implementation doesn't give us access to check it's config such as verification/certs, thus making it impossible to transfer the config to the crucial websocket builder. Feel free to merge my changes, or think of a cleaner way to keep options set only in one place, as now we need to do it in 2 places.