Bug 1273817 - "--timestamps" doesn't work for `oc logs`
Summary: "--timestamps" doesn't work for `oc logs`
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Michail Kargakis
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-21 10:13 UTC by Wei Sun
Modified: 2016-01-05 06:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-23 21:15:29 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Wei Sun 2015-10-21 10:13:25 UTC
Description of problem:
Show the logs with "--timestamps",when "--timestamps=true",the logs show timestamps,like "09:36:42.480007",but when "--timestamps=false",the logs still show timestamps,like "09:36:42.480007"


Version-Release number of selected component (if applicable):
devenv-rhel_2504
# oc version
oc v1.0.6-801-ge74f43a
kubernetes v1.2.0-alpha.1-1107-g4c8e6f4

How reproducible:
Always

Steps to Reproduce:
1.oc logs bc/nd --timestamps=false > bc1.log
2.oc logs bc/nd --timestamps=true > bc2.log
3.diff bc1.log bc2.log
4.Check bc1.log and bc2.log

Actual results:
3.bc1.log is same with bc2.log
4.In bc1.log and bc2.log,the logs are like:
I1021 09:35:52.868137       1 sti.go:407] mongodb.46 node_modules/mongodb
I1021 09:35:52.868141       1 sti.go:407] ├── readable-stream.31 (inherits.1, isarray.1, string_decoder.31, core-util-is.1)
I1021 09:35:52.868144       1 sti.go:407] ├── es6-promise.1
I1021 09:35:52.868148       1 sti.go:407] └── mongodb-core.19 (bson.19, kerberos.15)
E1021 09:35:52.868161       1 util.go:85] npm info ok
I1021 09:36:18.704374       1 sti.go:149] Using provided push secret for pushing 172.30.255.67:5000/wsuntest/nd:latest image
I1021 09:36:18.704988       1 sti.go:151] Pushing 172.30.255.67:5000/wsuntest/nd:latest image ...
I1021 09:36:42.480007       1 sti.go:155] Successfully pushed 172.30.255.67:5000/wsuntest/nd:latest


The timestamps "09:36:42.480007" is shown when "--timestamps=false" 

Expected results:
When "--timestamps=false",the timestamps should be shown 

Additional info:

Comment 1 David Eads 2015-10-22 16:56:39 UTC
I think I'd like to fix this by including the PodLogOptions on the BuildLogOptions.  Be sure to keep `Follow` backwards compatible.

Thanks for picking this up.

Comment 2 Michail Kargakis 2015-10-27 17:44:41 UTC
Will be fixed post 3.1

Comment 3 Michail Kargakis 2015-10-30 16:15:01 UTC
Fixed in latest master

Comment 4 Wei Sun 2015-11-02 02:32:38 UTC
Verified in the devenv-rhel7_2619

Result:
1.# oc logs bc/rubytest -n wsuntest --timestamps=false
Already on 'master'
I1102 02:24:06.247261       1 sti.go:448] ---> Installing application source ...
I1102 02:24:06.248976       1 sti.go:448] ---> Building your Ruby application from source ...
I1102 02:24:06.249129       1 sti.go:448] ---> Running 'bundle install ' ...
I1102 02:24:09.095606       1 sti.go:448] Fetching gem metadata from https://rubygems.org/..........
I1102 02:24:09.459085       1 sti.go:448] Resolving dependencies...
I1102 02:24:10.637763       1 sti.go:448] Installing rack (1.6.4) 
I1102 02:24:10.637857       1 sti.go:448] Using bundler (1.3.5) 
I1102 02:24:10.638319       1 sti.go:448] Your bundle is complete!
I1102 02:24:10.638399       1 sti.go:448] It was installed into ./bundle
I1102 02:24:10.653591       1 sti.go:448] ---> Cleaning up unused ruby gems ...
I1102 02:24:16.093908       1 sti.go:221] Using provided push secret for pushing 172.30.125.194:5000/wsuntest/rubytest:latest image
I1102 02:24:16.093934       1 sti.go:225] Pushing 172.30.125.194:5000/wsuntest/rubytest:latest image ...
I1102 02:25:16.835121       1 sti.go:241] Successfully pushed 172.30.125.194:5000/wsuntest/rubytest:latest


2.# oc logs bc/rubytest -n wsuntest --timestamps=true
2015-11-02T02:24:05.889003851Z Already on 'master'
2015-11-02T02:24:06.247700344Z I1102 02:24:06.247261       1 sti.go:448] ---> Installing application source ...
2015-11-02T02:24:06.249087927Z I1102 02:24:06.248976       1 sti.go:448] ---> Building your Ruby application from source ...
2015-11-02T02:24:06.256048311Z I1102 02:24:06.249129       1 sti.go:448] ---> Running 'bundle install ' ...
2015-11-02T02:24:09.095929780Z I1102 02:24:09.095606       1 sti.go:448] Fetching gem metadata from https://rubygems.org/..........
2015-11-02T02:24:09.459337914Z I1102 02:24:09.459085       1 sti.go:448] Resolving dependencies...
2015-11-02T02:24:10.638237439Z I1102 02:24:10.637763       1 sti.go:448] Installing rack (1.6.4) 
2015-11-02T02:24:10.638249744Z I1102 02:24:10.637857       1 sti.go:448] Using bundler (1.3.5) 
2015-11-02T02:24:10.638361386Z I1102 02:24:10.638319       1 sti.go:448] Your bundle is complete!
2015-11-02T02:24:10.638594188Z I1102 02:24:10.638399       1 sti.go:448] It was installed into ./bundle
2015-11-02T02:24:10.653926547Z I1102 02:24:10.653591       1 sti.go:448] ---> Cleaning up unused ruby gems ...
2015-11-02T02:24:16.093984097Z I1102 02:24:16.093908       1 sti.go:221] Using provided push secret for pushing 172.30.125.194:5000/wsuntest/rubytest:latest image
2015-11-02T02:24:16.094193350Z I1102 02:24:16.093934       1 sti.go:225] Pushing 172.30.125.194:5000/wsuntest/rubytest:latest image ...
2015-11-02T02:25:16.837806230Z I1102 02:25:16.835121       1 sti.go:241] Successfully pushed 172.30.125.194:5000/wsuntest/rubytest:latest


Note You need to log in before you can comment on or make changes to this bug.