Bug 1462997 - "--since-time" does not work for oc logs
Summary: "--since-time" does not work for oc logs
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.1.1
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ---
: ---
Assignee: Jordan Liggitt
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On: 1286116
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-19 20:40 UTC by Ryan Howe
Modified: 2020-08-13 09:24 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1286116
Environment:
Last Closed: 2017-06-27 16:38:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Comment 3 Jordan Liggitt 2017-06-21 16:04:48 UTC
The --since-time fix in 3.2 is not able to be backported to 3.1

--since allows specifying relative time (for example, '--since=60s' shows the last 60 seconds of logs) and works in 3.1

Comment 4 Eric Paris 2017-06-27 16:38:20 UTC
Given the major refactoring in this area between 3.2 and 3.1 the 3.2 fix can not be backported. Thus any fix in 3.1 would be wholly untested as it would be a completely new fix. In 3.1 the code that processes --since-time also processes a lot of other time fields in the API and thus any changes could have great risk across the system.

In 3.1 the --since flag works and a simple script can translate times which would have been passed to --since-time to --since:

$ THEN=$(date --date='2017-06-20 13:24:00' +%s)
$ NOW=$(date +%s)
$ SINCE=$(( ${NOW} - ${THEN} ))
$ oc logs --since="${SINCE}s"

Since fixing this introduces a risk of major regression and there is a small usable workaround engineering does not plan to address this BZ in 3.1.


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