Bug 1276213

Summary: The logs for all the containers are the same with the first container when the pod has multiple containers.
Product: OKD Reporter: Yanping Zhang <yanpzhan>
Component: Management ConsoleAssignee: Samuel Padgett <spadgett>
Status: CLOSED CURRENTRELEASE QA Contact: Yadan Pei <yapei>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, jforrest, mmccomas, spadgett
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-23 21:13:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
first-container
none
second-container
none
third-container none

Description Yanping Zhang 2015-10-29 06:00:56 UTC
Description of problem:
Create a pod with multiple containers, check each containter's log on web console. The logs for all the containers are the same with the first container.

Version-Release number of selected component (if applicable):
openshift v1.0.6-1053-gbd6a762
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2


How reproducible:
Always

Steps to Reproduce:
1.Create a pod with multiple containers.
$ oc create -f multiple-container.yaml -n prozyp
2.Check all the containers's log on cli.
3.View all the containers's log on web console.

Actual results:
2.
$ oc logs multiplecontainers -c hello-openshift -n prozyp
Started, serving at 8080
$ oc logs multiplecontainers -c hello-two -n prozyp
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
$ oc logs multiplecontainers -c hello-openshift-fedora -n prozyp
serving on 8081
serving on 8888
3.All the logs are the same with the first container's log. Pls refer to the attachments.

Expected results:
3.On web console,the logs should be same with the output of `oc logs`.

Additional info:

Comment 1 Yanping Zhang 2015-10-29 06:03:46 UTC
Created attachment 1087376 [details]
first-container

Comment 2 Yanping Zhang 2015-10-29 06:04:35 UTC
Created attachment 1087377 [details]
second-container

Comment 3 Yanping Zhang 2015-10-29 06:05:10 UTC
Created attachment 1087378 [details]
third-container

Comment 4 Jessica Forrester 2015-10-29 13:45:10 UTC
Ben, I saw this at the end of the day yesterday, its because of this line:
https://github.com/openshift/origin/commit/a03cd35eb8f7a332503022ebc6b3e9fc1152d459#diff-e81d5d378cb83bfc99a6fb64f5e492b6R102

Any time runLogs gets called its resetting container to containers[0].name

Comment 5 Jessica Forrester 2015-10-29 15:20:49 UTC
PR https://github.com/openshift/origin/pull/5489

Comment 6 Samuel Padgett 2015-10-30 17:17:30 UTC
5489 was closed in place of 5537

https://github.com/openshift/origin/pull/5537

Comment 7 Yanping Zhang 2015-11-02 02:46:25 UTC
Tested on devenv-rhel7_2619.
openshift v1.0.7-109-g3cf7f3c
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4
etcd 2.1.2
Steps to verify:
1.Create a pod with multiple containers.
$ oc create -f multiple-container.yaml -n prozyp
2.View all the containers' log on web console.
When switch container, the log is displayed correctly for the container.

The bug has been fixed, so move the bug to Verified.