Bug 1462997 - "--since-time" does not work for oc logs
"--since-time" does not work for oc logs
Product: OpenShift Container Platform
Classification: Red Hat
Component: Pod (Show other bugs)
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: Jordan Liggitt
DeShuai Ma
Depends On: 1286116
  Show dependency treegraph
Reported: 2017-06-19 16:40 EDT by Ryan Howe
Modified: 2017-06-27 12:38 EDT (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1286116
Last Closed: 2017-06-27 12:38:20 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Comment 3 Jordan Liggitt 2017-06-21 12:04:48 EDT
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 12:38:20 EDT
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.