1
0
mirror of https://github.com/moby/moby.git synced 2025-07-30 18:23:29 +03:00

Get events until a time in the past.

This change allow to filter events that happened in the past
without waiting for future events. Example:

docker events --since -1h --until -30m

Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
David Calavera
2016-04-11 11:52:34 -07:00
parent 577adcc1ee
commit 55053d3537
12 changed files with 291 additions and 135 deletions

View File

@ -6450,7 +6450,7 @@ func (s *DockerSuite) TestBuildNoNamedVolume(c *check.C) {
}
func (s *DockerSuite) TestBuildTagEvent(c *check.C) {
since := daemonTime(c).Unix()
since := daemonUnixTime(c)
dockerFile := `FROM busybox
RUN echo events
@ -6458,7 +6458,8 @@ func (s *DockerSuite) TestBuildTagEvent(c *check.C) {
_, err := buildImage("test", dockerFile, false)
c.Assert(err, check.IsNil)
out, _ := dockerCmd(c, "events", fmt.Sprintf("--since=%d", since), fmt.Sprintf("--until=%d", daemonTime(c).Unix()), "--filter", "type=image")
until := daemonUnixTime(c)
out, _ := dockerCmd(c, "events", "--since", since, "--until", until, "--filter", "type=image")
events := strings.Split(strings.TrimSpace(out), "\n")
actions := eventActionsByIDAndType(c, events, "test:latest", "image")
var foundTag bool