Description of problem: Launching the following pod: apiVersion: v1 kind: Pod metadata: name: counter spec: containers: - name: count image: busybox args: - /bin/sh - -c - > i=0; while true; do echo "$i: $(date)" >> /var/log/1.log; echo "$(date) INFO $i" >> /var/log/2.log; i=$((i+1)); sleep 1; done volumeMounts: - name: varlog mountPath: /var/log - name: count-log-1 image: busybox args: [/bin/sh, -c, 'tail -n+1 -f /var/log/1.log'] volumeMounts: - name: varlog mountPath: /var/log - name: count-log-2 image: busybox args: [/bin/sh, -c, 'tail -n+1 -f /var/log/2.log'] volumeMounts: - name: varlog mountPath: /var/log volumes: - name: varlog emptyDir: {} When viewing the logs from the web console, and selecting "count-log-1" or "count-log-2", and then selecting another container causes the logs to "bleed" into the other views (I'm guessing the original websocket just never closes, so now both websockets just write into the same window) Version-Release number of selected component (if applicable): OpenShift Master: v3.3.1.3 Kubernetes Master: v1.3.0+52492b4 How reproducible: always Steps to Reproduce: 1. oc create -f https://raw.githubusercontent.com/kubernetes/kubernetes.github.io/master/docs/user-guide/logging/examples/two-files-counter-pod-streaming-sidecar.yaml 2. View logs tab for pod in web console 3. Toggle between "count-log-1" and then back to "count". Actual results: The logs from "count-log-1" continue to show in "count" Expected results: "count" should remain empty Additional info:
master PR: https://github.com/openshift/origin-web-console/pull/1310 enterprise-3.5 PR: https://github.com/openshift/origin-web-console/pull/1311
Commit pushed to master at https://github.com/openshift/origin-web-console https://github.com/openshift/origin-web-console/commit/12803823e767b0302dea97babbeca3f874207a76 Bug 1427289 - Fix log updates when switching containers The `onClose` callback for log streamers happens asynchronously. Make sure the `onClose` cleanup happens before we begin streaming the next container log. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1427289
This has been merged into ocp and is in OCP v3.5.0.37 or newer.
Reproduced the bug on OCP v3.5.0.34. Checked on OCP v3.5.0.37, logs for different containers of a pod can be shown correctly now.
Verified on OCP v3.5.0.37 The logs from "count-log-1" and "count" show different content respectively.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:0884