Commit graph

114 commits

Author SHA1 Message Date
Kai Qiang Wu(Kennan)
0656105710 Add load/save image event support
For every docker load and save operations, it would log related
image events.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-04-27 01:11:03 +00:00
Brian Goff
bb91bd3a89 Merge pull request #22043 from WeiZhang555/remove-start-event-failed-start
Remove start/die event when fail to start container
2016-04-19 19:45:40 -04:00
Brian Goff
19a453e6b4 Merge pull request #21939 from calavera/events_until_past
Get events until a time in the past.
2016-04-15 15:33:41 -04:00
Zhang Wei
5548966c37 Remove start/die event when fail to start container
If contaner start fail of (say) "command not found", the container
actually didn't start at all, we shouldn't log start and die event for
it, because that doesnt actually happen.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-15 13:02:34 +08:00
David Calavera
55053d3537
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>
2016-04-14 16:22:16 -07:00
Vincent Demeester
a0e7e13766 Merge pull request #21818 from Microsoft/jjh/tp4fortests
Windows: Remove TP4 support from test code
2016-04-12 10:07:12 +02:00
John Howard
b0e24c7393 Windows: Remove TP4 support from test code
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-04-11 15:36:31 -07:00
Sebastiaan van Stijn
eaa1e8a8c4 Merge pull request #21839 from WeiZhang555/add-start-event
Add missing "start" event back for auto-restart container
2016-04-08 17:52:22 -07:00
Zhang Wei
fdfaaeb9aa Add missing "start" event back for auto-restart container
When container is automatically restarted based on restart policy,
docker events can't get "start" event but only get "die" event, this is
not consistent with previous behavior. This commit will add "start"
event back.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-04-08 11:40:32 +08:00
Alexander Morozov
3f358aeaca integration-cli: try to make TestEventsTimestampFormats less flaky
Fix #21749

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2016-04-06 14:31:39 -07:00
Brian Goff
42df9edc4a Better logging for errors in some tests
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2016-03-25 10:02:52 -04:00
David Calavera
a9f2006f10 Compare event nanoseconds properly to filter since a specific date.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-03-08 17:07:58 -05:00
John Howard
6a931c3590 Windows CI: Integrity check for busybox top
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-02-24 11:00:47 -08:00
Victor Vieux
99a396902f fix common misspell
Signed-off-by: Victor Vieux <vieux@docker.com>
2016-02-11 15:49:36 -08:00
Alexander Morozov
1bc4c99372 Merge pull request #19761 from HackToday/enhancesortattr
Sort the attributes for events
2016-02-02 16:08:23 -08:00
Kai Qiang Wu(Kennan)
746f6af9aa Sort the attributes for events
This is add support for #19559
We tried sort it in client side, and it sort follow go
sort : sorts a slice of strings in increasing order.

Signed-off-by: Kai Qiang Wu(Kennan) <wkqwu@cn.ibm.com>
2016-02-01 00:18:33 +00:00
John Howard
59f4369f1a Windows CI: Turn off unreliable TP4 tests
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-01-31 15:51:56 -08:00
Antonio Murdaca
98ef10f64e Merge pull request #19839 from Microsoft/jjh/testevents
Windows CI: Porting TestEvents*
2016-01-30 11:47:44 +01:00
John Howard
bf33742026 Windows CI: Porting TestEvents*
Signed-off-by: John Howard <jhoward@microsoft.com>
2016-01-29 12:33:56 -08:00
Zhang Wei
62a856e912 Assert error in body of function inspectField*
1. Replace raw `docker inspect -f xxx` with `inspectField`, to make code
cleaner and more consistent
2. assert the error in function `inspectField*` so we don't need to
assert the return value of it every time, this will make inspect easier.

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-29 23:39:07 +08:00
Doug Davis
e5b5c0ebe8 Merge pull request #19713 from WeiZhang555/opt-TestEventsContainerFailStartDie
Optimize `TestEventsContainerFailStartDie`
2016-01-26 09:32:52 -05:00
Zhang Wei
4f7dda3fb2 Optimize TestEventsContainerFailStartDie
Optimize performance of `TestEventsContainerFailStartDie`

Signed-off-by: Zhang Wei <zhangwei555@huawei.com>
2016-01-26 19:23:18 +08:00
Shijiang Wei
77a0f77e7f optimize DockerSuite.TestEventsAttach
Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2016-01-26 10:45:45 +08:00
David Calavera
851fe00c64 Add filter by event type and documentation.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2016-01-04 14:58:04 -05:00
David Calavera
9d12d09300 Add volume events.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-30 17:39:33 -05:00
David Calavera
72f1881df1 Add event types.
- Stop serializing JSONMessage in favor of events.Message.
- Keep backwards compatibility with JSONMessage for container events.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-30 17:39:33 -05:00
David Calavera
af51df20bd Extract event processing to a common function for testing.
We keep only one logic to test event related behavior that will help us
diagnose flacky event errors.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-22 17:10:06 -05:00
David Calavera
a3056f9f72 Log events stream when TestEventStreaming fails.
Let the tag event some more time to be emitted.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-12-11 17:20:40 -05:00
Stefan Scherer
88c1bc10c4 Increase timeouts to fix test on ARM
Signed-off-by: Stefan Scherer <scherer_stefan@icloud.com>
2015-11-20 23:12:12 +01:00
Srini Brahmaroutu
b1cc78b8f5 Build and test Docker on IBM Power and Z using gccgo. Enable CI on Power and Z.
Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
2015-11-14 03:16:45 +00:00
Mohammed Aaqib Ansari
2910f1101d Using checkers assert for integration-cli/docker_cli_events_test.go
Signed-off-by: Mohammed Aaqib Ansari <maaquib@gmail.com>
2015-11-11 18:12:30 -05:00
Shijiang Wei
2968fa44eb emit a "tag" event when building image with "-t" parameter
This is useful for cluster systems such as swarm to sync the image
state when new images are successfully built.

Signed-off-by: Shijiang Wei <mountkin@gmail.com>
2015-10-19 20:09:14 +08:00
Daniel Nephin
08b117517d Resolves #16458 - filter events by labels.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2015-10-02 16:33:20 -04:00
Tibor Vass
b08f071e18 Revert "Merge pull request #16228 from duglin/ContextualizeEvents"
Although having a request ID available throughout the codebase is very
valuable, the impact of requiring a Context as an argument to every
function in the codepath of an API request, is too significant and was
not properly understood at the time of the review.

Furthermore, mixing API-layer code with non-API-layer code makes the
latter usable only by API-layer code (one that has a notion of Context).

This reverts commit de41640435, reversing
changes made to 7daeecd42d.

Signed-off-by: Tibor Vass <tibor@docker.com>

Conflicts:
	api/server/container.go
	builder/internals.go
	daemon/container_unix.go
	daemon/create.go
2015-09-29 14:26:51 -04:00
Doug Davis
26b1064967 Add context.RequestID to event stream
This PR adds a "request ID" to each event generated, the 'docker events'
stream now looks like this:

```
2015-09-10T15:02:50.000000000-07:00 [reqid: c01e3534ddca] de7c5d4ca927253cf4e978ee9c4545161e406e9b5a14617efb52c658b249174a: (from ubuntu) create
```
Note the `[reqID: c01e3534ddca]` part, that's new.

Each HTTP request will generate its own unique ID. So, if you do a
`docker build` you'll see a series of events all with the same reqID.
This allow for log processing tools to determine which events are all related
to the same http request.

I didn't propigate the context to all possible funcs in the daemon,
I decided to just do the ones that needed it in order to get the reqID
into the events. I'd like to have people review this direction first, and
if we're ok with it then I'll make sure we're consistent about when
we pass around the context - IOW, make sure that all funcs at the same level
have a context passed in even if they don't call the log funcs - this will
ensure we're consistent w/o passing it around for all calls unnecessarily.

ping @icecrime @calavera @crosbymichael

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-09-24 11:56:37 -07:00
Hu Keping
5505bcdd62 Fix test for container events
Signed-off-by: Hu Keping <hukeping@huawei.com>
2015-09-24 19:04:54 +08:00
John Howard
f9a3558a9d Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
2015-09-04 12:32:40 -07:00
Vincent Demeester
799d9605d6 Remove/Comment time.Sleep in integration tests
Remove what seems unnecessary time.Sleep (1 second even) and comment the
ones that seemed necessary.

Signed-off-by: Vincent Demeester <vincent@sbr.pm>
2015-08-18 20:36:08 +02:00
Veres Lajos
5146232723 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
2015-08-07 23:25:49 +01:00
Brian Goff
693ba98cb9 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-07-27 14:33:32 -04:00
Josh Hawn
418135e7ea integration-cli: New docker cp integration tests
Adds several integration tests for `docker cp` behavior with over a dozen
tests for each of:

  container -> local
  local -> container

Docker-DCO-1.1-Signed-off-by: Josh Hawn <josh.hawn@docker.com> (github: jlhawn)
2015-07-21 15:19:52 -07:00
Qiang Huang
668e2369cc dockerCmd when possible
Addresses: #14603

integration-cli/docker_cli_daemon_experimental_test.go (hqhq)
integration-cli/docker_cli_daemon_test.go (hqhq)
integration-cli/docker_cli_diff_test.go (hqhq)
integration-cli/docker_cli_events_test.go (hqhq)
integration-cli/docker_cli_events_unix_test.go (hqhq)
integration-cli/docker_cli_exec_test.go (hqhq)
integration-cli/docker_cli_exec_unix_test.go (hqhq)
integration-cli/docker_cli_experimental_test.go (hqhq)
integration-cli/docker_cli_export_import_test.go (hqhq)
integration-cli/docker_cli_help_test.go (hqhq)
integration-cli/docker_cli_history_test.go (hqhq)
integration-cli/docker_cli_images_test.go (hqhq)
integration-cli/docker_cli_import_test.go (hqhq)
integration-cli/docker_cli_info_test.go (hqhq)
integration-cli/docker_cli_inspect_test.go (hqhq)
integration-cli/docker_cli_kill_test.go (hqhq)

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
2015-07-20 14:55:40 +08:00
Jessie Frazelle
2cd417df73 Merge pull request #14388 from runcom/14316-fix-events-filters
Fix combined image events filters
2015-07-07 18:08:56 -07:00
Lei Jitang
2802831218 Fix test TestEventsDefaultEmpty. Fixes #14360
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-07-07 11:27:00 +08:00
Antonio Murdaca
19e6de2654 Fix combined image events filters
Signed-off-by: Antonio Murdaca <runcom@linux.com>
2015-07-04 00:19:08 +02:00
Brian Goff
74c12aa429 Default events since to current time
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-06-10 12:37:40 -04:00
Antonio Murdaca
f18ce101fb Merge pull request #13165 from ahmetalpbalkan/durations
Allow duration strings as --since/--until
2015-06-03 22:14:42 +02:00
David Calavera
6c42b3947a Merge pull request #12838 from fntlnz/test-cmd
Using dockerCmd when possible
2015-06-02 14:12:22 -07:00
Ahmet Alp Balkan
4e3b21f99e Allow duration strings as --since/--until
Fixes #13107. This change enables Go duration strings
computed relative to the client machine’s time to be used
as input parameters to `docker events --since/--until`
and `docker logs --since` arguments.

Added unit tests for pkg/timeutils.GetTimestamp as well.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-06-02 21:02:47 +00:00
Doug Davis
8232312c1e Cleanup container LogEvent calls
Move some calls to container.LogEvent down lower so that there's
less of a chance of them being missed. Also add a few more events
that appear to have been missed.

Added testcases for new events: commit, copy, resize, attach, rename, top

Signed-off-by: Doug Davis <dug@us.ibm.com>
2015-06-01 12:39:28 -07:00