Pod logs not ending in line break are not shown
Describe the bug When viewing the logs, if the last line is not ending in a line break it doesn't appear in the logs view.
To Reproduce Steps to reproduce the behavior:
- Create the file
test.ymlwith the following content:
apiVersion: v1
kind: Pod
metadata:
name: test
spec:
containers:
- name: test
image: ubuntu:22.04
command: ["curl", "https://httpbin.org/base64/whatever"]
- Apply the manifest with
kubectl apply -f test.yml - Open the logs of the test pod in k9s
- Logs only shows
Stream closed EOF for xxxxx/test (test). It doesn't change with other modes (tail, head, 1m, 30m, etc.)
Expected behavior
In step 4 it should log Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21l
Screenshots N/A
Versions (please complete the following information):
- OS: macOS 12.4
- K9s: v0.26.7
- K8s: v1.23.12
Additional context
Executing the curl command in bash shows that there is no line break at the end of the response:
bash-5.2$ curl https://httpbin.org/base64/whatever
Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21lbash-5.2$
Adding a new situation: When I trying to check the log from cronjob, if it only has one line of log, k9s shows nothing but a yellow sentence Stream closed EOF for xxx
Just checked with the latest version (0.32.5), still there. I needed to update the k8s manifest, the old one didn't work anymore.
apiVersion: batch/v1
kind: Job
metadata:
name: myjob
spec:
ttlSecondsAfterFinished: 100
template:
spec:
containers:
- name: love
image: curlimages/curl
args: [curl, -s, https://httpbin.org/base64/whatever]
restartPolicy: Never
When requesting the logs, k9s displays:
Stream closed EOF for default/myjob-jpvnc (love)
With kubectl:
$ kubectl logs myjob-jpvnc
Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21lā
Have this issue on v0.40.5. When looking at pod logs from a job, if last line doesn't have line break, k9s doesn't show it.
This issue is stale because it has been open for 30 days with no activity.