mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 21:51:33 +00:00
Merge pull request #13165 from ahmetalpbalkan/durations
Allow duration strings as --since/--until
This commit is contained in:
@@ -29,9 +29,10 @@ func (s *DockerSuite) TestEventsTimestampFormats(c *check.C) {
|
||||
// List of available time formats to --since
|
||||
unixTs := func(t time.Time) string { return fmt.Sprintf("%v", t.Unix()) }
|
||||
rfc3339 := func(t time.Time) string { return t.Format(time.RFC3339) }
|
||||
duration := func(t time.Time) string { return time.Now().Sub(t).String() }
|
||||
|
||||
// --since=$start must contain only the 'untag' event
|
||||
for _, f := range []func(time.Time) string{unixTs, rfc3339} {
|
||||
for _, f := range []func(time.Time) string{unixTs, rfc3339, duration} {
|
||||
since, until := f(start), f(end)
|
||||
cmd := exec.Command(dockerBinary, "events", "--since="+since, "--until="+until)
|
||||
out, _, err := runCommandWithOutput(cmd)
|
||||
|
||||
Reference in New Issue
Block a user