Commit graph

91 commits

Author SHA1 Message Date
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
Lorenzo Fontana
a2787469ac Using dockerCmd when possible
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
2015-05-19 20:33:59 +02:00
Ahmet Alp Balkan
1630ed97ac Introduce daemon event 'tag' upon image tagging
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-15 20:21:59 +00:00
Ahmet Alp Balkan
999f464feb Parse input timestamps with standard RFC3339
Fix for #13175.

This change allows user-input timestamps (e.g. to `docker events
--since/--until`  or `docker logs --since` to be parsed using
standard RFC3339Nano layout in Go instead of the layout that parses
all timestamps into fixed-length strings (currently buggy).

User inputs need not to be complying to the internal format
(`RFC3339NanoFixed`) anyway.

Added test case for `events --since/--until` with all possible
timestamp input formats.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
2015-05-14 07:44:42 +00:00
Antonio Murdaca
4203230cbb c.Fatal won't fail and exit test inside a goroutine, errors should be handled outside with a channel
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-29 17:02:22 +02:00
Lorenzo Fontana
40779b28bb Parallelize TestEventsLimit
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
2015-04-27 21:14:00 +02:00
Brian Goff
03719be830 Merge pull request #12754 from LK4D4/carry_12707
fix runtime issue for TestEventsFilterContainer
2015-04-24 14:36:58 -04:00
Daniel Antlinger
07795c3f5d fix runtime issue for TestEventsFilterContainer
Signed-off-by: Daniel Antlinger <d.antlinger@gmx.at>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:48:40 -07:00
Alexander Morozov
a9688cdca5 Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-24 10:37:21 -07:00
Antonio Murdaca
eeb8ceb9ed Fix TestEventsImageImport racy, fixes #12499
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-22 17:30:30 +02:00
Alexander Morozov
dc944ea7e4 Use suite for integration-cli
It prints test name and duration for each test.
Also performs deleteAllContainers after each test.

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-21 10:28:52 -07:00
bobby abbott
621b601b3c Removed unnecessary error output from dockerCmd
Changed method declaration. Fixed all calls to dockerCmd
method to reflect the change.

resolves #12355

Signed-off-by: bobby abbott <ttobbaybbob@gmail.com>
2015-04-17 09:11:14 -07:00
Alexander Morozov
b02cf5239e Merge pull request #12115 from cpuguy83/fix_events_filter_test
Cleanup events filter by container test
2015-04-09 11:40:08 -07:00
Liu Hua
645c020f5a fix up Image-name related issues in docker ps and CI
This patch include the following fixs:
 - fix image name error when docker ps
 - fix docker events test failure: use the exact image name for filter
 - fix docker build CI test failure due to "docker events" change

Because of change of daemon log behavior. Now we record
the exact Image name as you typed. So docker run -d busybux sh
and docker run -d busybox:latest are not the same in the log.
So it will affect the docker events. So change the related CI

Signed-off-by: Liu Hua <sdu.liu@huawei.com>
2015-04-09 23:03:23 +08:00
Brian Goff
7e70998bb8 Cleanup events filter by container test
This also seemed to be checking the ordering of the events, which
doesn't seem like something we sould be interested in this particular
test.

Added check to make sure the filtered events have the expected ID's.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-09 09:47:58 -04:00
Alexander Morozov
8fd2b52146 Fix fail message in TestEventsImageImport
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-04-07 14:22:43 -07:00
Alexandr Morozov
e45bf8d2e9 Decrease timeouts in TestEventsStreaming
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2015-04-06 13:40:56 -07:00
Alexandr Morozov
5fa3a6f248 Pass right timestamp instead of crap from string(int64)
Problem is that --since can consume anything not near looking as
timestamp.

Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
2015-04-06 13:39:02 -07:00
Antonio Murdaca
d1c4439b5a Test events streaming, fixes #12079
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
2015-04-06 19:00:17 +02:00
Arnaud Porterie
b9d2ede4d4 Merge pull request #12107 from cpuguy83/remove_striptrailingchars
Remove `stripTrailingCharacters` from tests
2015-04-06 08:46:08 -07:00
Brian Goff
475c65319b Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2015-04-06 09:21:18 -04:00
Arnaud Porterie
9c505c906d Merge pull request #11571 from noironetworks/11555-Docker-since-beginning-of-unix-time-doesnt-work
Fixes docker events since beginning of unix time
2015-04-02 15:03:04 -07:00
André Martins
8f7ac20bac Fixes docker events since beginning of unix time
Fixes issue #11555
Applied a workaround to check if since and until flags are valid or not.

Signed-off-by: André Martins <martins@noironetworks.com>
2015-04-01 18:14:59 +01:00
Mabin
e15c3e36cc Fix random bug in cli events test
Signed-off-by: Mabin <bin.ma@huawei.com>
2015-04-01 11:00:01 +08:00