You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting logs from a single container pod fails under windows. It seems that the container name is single quoted in the cmd string.
Here's the output from kubel-process buffer: command: kubectl --context mycontext logs --tail=100 pod-name-0 'container-name'
Unfortunately single quote doesn't seem to be valid in cmd.exe. The same command with double or without quotes works.
From my understanding, kubel--get-containers output is single quoted because single quote usage in jsonpath
C:\Users\user>kubectl get pods -n cvaas pod-name-0 -o jsonpath="{.spec.%s[*].name}"
C:\Users\user>kubectl get pods -n cvaas pod-name-0 -o jsonpath='{.spec.%s[*].name}'
''
Note sure why the command has the single container name inside the quotes (my elisp reading skills are...), but I could confirm replacing the single quotes from jsonpath by escaped double quotes fixes the issue.
Can't guarantee I'll be able to submit a PR with fully tested code before next week.
But here's the patch in the meantime : kubel-windows-support.txt, only tested the kubectl log part though.
Tested with :
kubectl version : 1.23
kubel version (latest master): b598b21
Windows 10.x
The text was updated successfully, but these errors were encountered:
Hi! Thank you for reporting this!
Unfortunately I do not use a windows machine so I cannot reproduce or confirm that your patch fix it, but I can test that it won't break for Linux/Mac.
No rush at all for a PR, I'm pretty swamped myself, but I thank you in any case.
I can confirm this issue, and it's a problem with all the jsonpath queries (namespaces, resources, etc.). The single quotes end up at the ends of the lists literally, and so once the list is split one item has a single quote before, and one item has a single quote after. In the case of a singleton list (viewing log of a pod with one container) the item is entirely quoted.
However I fixed this by removing the single quotes altogether. I'm not sure they are needed on Mac/Linux either?
Hello,
Getting logs from a single container pod fails under windows. It seems that the container name is single quoted in the cmd string.
Here's the output from
kubel-process
buffer:command: kubectl --context mycontext logs --tail=100 pod-name-0 'container-name'
Unfortunately single quote doesn't seem to be valid in cmd.exe. The same command with double or without quotes works.
From my understanding,
kubel--get-containers
output is single quoted because single quote usage in jsonpathNote sure why the command has the single container name inside the quotes (my elisp reading skills are...), but I could confirm replacing the single quotes from jsonpath by escaped double quotes fixes the issue.
Can't guarantee I'll be able to submit a PR with fully tested code before next week.
But here's the patch in the meantime : kubel-windows-support.txt, only tested the kubectl log part though.
Tested with :
kubectl version : 1.23
kubel version (latest master): b598b21
Windows 10.x
The text was updated successfully, but these errors were encountered: