Commit Graph

83 Commits

Author SHA1 Message Date
12d92cfae8 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>
Upstream-commit: 2968fa44eb2a53c121ad2b27c519ae47ca7653c3
Component: engine
2015-10-19 20:09:14 +08:00
1dfde818a2 Resolves #16458 - filter events by labels.
Signed-off-by: Daniel Nephin <dnephin@docker.com>
Upstream-commit: 08b117517d6d6b5daebe4c056c135e1598f44385
Component: engine
2015-10-02 16:33:20 -04:00
69db6279aa 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 de4164043546d2b9ee3bf323dbc41f4979c84480, reversing
changes made to 7daeecd42d7bb112bfe01532c8c9a962bb0c7967.

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

Conflicts:
	api/server/container.go
	builder/internals.go
	daemon/container_unix.go
	daemon/create.go
Upstream-commit: b08f071e18043abe8ce15f56826d38dd26bedb78
Component: engine
2015-09-29 14:26:51 -04:00
bf44c732da 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>
Upstream-commit: 26b1064967d9fcefd4c35f60e96bf6d7c9a3b5f8
Component: engine
2015-09-24 11:56:37 -07:00
fcffa49e7d Fix test for container events
Signed-off-by: Hu Keping <hukeping@huawei.com>
Upstream-commit: 5505bcdd628de4a45781609bdc10d203aab77834
Component: engine
2015-09-24 19:04:54 +08:00
c03ccb6893 Windows: Get Integration CLI running
Signed-off-by: John Howard <jhoward@microsoft.com>
Upstream-commit: f9a3558a9d75ed6a2f9f1b2d80800226afaa74a5
Component: engine
2015-09-04 12:32:40 -07:00
22da8315f6 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>
Upstream-commit: 799d9605d6d37a0f5c559b0325d924ad183ff4ee
Component: engine
2015-08-18 20:36:08 +02:00
2c6e673ce7 typofix - https://github.com/vlajos/misspell_fixer
Signed-off-by: Veres Lajos <vlajos@gmail.com>
Upstream-commit: 514623272398574c8fd7ef3fe42c5b2ae161349a
Component: engine
2015-08-07 23:25:49 +01:00
6e14356132 Don't pass check.C to dockerCmdWithError
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 693ba98cb9118bf15caaabc69ca281c0ce604226
Component: engine
2015-07-27 14:33:32 -04:00
471920cd35 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)
Upstream-commit: 418135e7eac6e664834b8a9d09d8051ec296a48f
Component: engine
2015-07-21 15:19:52 -07:00
0b00c6ae1a 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>
Upstream-commit: 668e2369cc5d57d634d0e559241ea4c4cbde65d8
Component: engine
2015-07-20 14:55:40 +08:00
38036b2494 Merge pull request #14388 from runcom/14316-fix-events-filters
Fix combined image events filters
Upstream-commit: 2cd417df7378e52c05569fa4340f5126d03fbaa8
Component: engine
2015-07-07 18:08:56 -07:00
5bdb87278d Fix test TestEventsDefaultEmpty. Fixes #14360
Signed-off-by: Lei Jitang <leijitang@huawei.com>
Upstream-commit: 28028312183126102b8eb260b7112cc37dd5aca9
Component: engine
2015-07-07 11:27:00 +08:00
0504497d15 Fix combined image events filters
Signed-off-by: Antonio Murdaca <runcom@linux.com>
Upstream-commit: 19e6de26541a01155019ef715359393412bedcde
Component: engine
2015-07-04 00:19:08 +02:00
5a71e1d7b0 Default events since to current time
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 74c12aa42918e3f349afcb46e6e54b724ef789a9
Component: engine
2015-06-10 12:37:40 -04:00
2d31933cd6 Merge pull request #13165 from ahmetalpbalkan/durations
Allow duration strings as --since/--until
Upstream-commit: f18ce101fbdf6c62a5643f826ed69a8abb843d87
Component: engine
2015-06-03 22:14:42 +02:00
0fb31101e8 Merge pull request #12838 from fntlnz/test-cmd
Using dockerCmd when possible
Upstream-commit: 6c42b3947a6ad91fc487ba34fec634e9f5c48aea
Component: engine
2015-06-02 14:12:22 -07:00
add0a8eb5b 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>
Upstream-commit: 4e3b21f99e7fb7fac0075be2e7190d5f07c9ee66
Component: engine
2015-06-02 21:02:47 +00:00
4f79291859 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>
Upstream-commit: 8232312c1e705753d3db82dca3d9bb23e59c3b52
Component: engine
2015-06-01 12:39:28 -07:00
15949eba4d Using dockerCmd when possible
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
Upstream-commit: a2787469ac45085cc28a56f67b7c0a50bead893f
Component: engine
2015-05-19 20:33:59 +02:00
540e90ab62 Introduce daemon event 'tag' upon image tagging
Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: 1630ed97acc7bc3a08b57ce5acaa3d8e37a24694
Component: engine
2015-05-15 20:21:59 +00:00
c16c9cc586 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>
Upstream-commit: 999f464feb5b78e8ecc97625e70f3b1796d0a758
Component: engine
2015-05-14 07:44:42 +00:00
6982f607b4 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>
Upstream-commit: 4203230cbbf46238e38099c9073bdcad5f69a63f
Component: engine
2015-04-29 17:02:22 +02:00
6143f43f8d Parallelize TestEventsLimit
Signed-off-by: Lorenzo Fontana <fontanalorenzo@me.com>
Upstream-commit: 40779b28bb04dca6178ba17eaeb93265e2974ee1
Component: engine
2015-04-27 21:14:00 +02:00
f6e14ef42d Merge pull request #12754 from LK4D4/carry_12707
fix runtime issue for TestEventsFilterContainer
Upstream-commit: 03719be8302d904893b97c03a3bf94f50a376876
Component: engine
2015-04-24 14:36:58 -04:00
3acd724e10 fix runtime issue for TestEventsFilterContainer
Signed-off-by: Daniel Antlinger <d.antlinger@gmx.at>
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 07795c3f5db3aa8ff592b0606ab76d32db4c6d25
Component: engine
2015-04-24 10:48:40 -07:00
c48fdf0abd Implement teardown removeAllImages
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: a9688cdca5577d6db65d76f38bcbe4c1e6f5994f
Component: engine
2015-04-24 10:37:21 -07:00
766ebf1059 Fix TestEventsImageImport racy, fixes #12499
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: eeb8ceb9edb61f4b8889360e4c4a2c4250c2d9f6
Component: engine
2015-04-22 17:30:30 +02:00
1884ef3b9b 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>
Upstream-commit: dc944ea7e48d11a2906e751d3e61daf08faee054
Component: engine
2015-04-21 10:28:52 -07:00
5e15f55a29 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>
Upstream-commit: 621b601b3c602aab5ef0f07903fdf413881bb261
Component: engine
2015-04-17 09:11:14 -07:00
146dc925a6 Merge pull request #12115 from cpuguy83/fix_events_filter_test
Cleanup events filter by container test
Upstream-commit: b02cf5239eedc9cddac5a331c97183dc53c1e8ef
Component: engine
2015-04-09 11:40:08 -07:00
adca7cca6d 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>
Upstream-commit: 645c020f5ab7119cd06d7c6a790e9d99fe1cd309
Component: engine
2015-04-09 23:03:23 +08:00
f3865d2e92 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>
Upstream-commit: 7e70998bb80d47e3f3a363fb49feaeaf50d64cbc
Component: engine
2015-04-09 09:47:58 -04:00
7753b7bbca Fix fail message in TestEventsImageImport
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: 8fd2b52146b443dd464df5199d79c69047c81eea
Component: engine
2015-04-07 14:22:43 -07:00
5c284b836c Decrease timeouts in TestEventsStreaming
Signed-off-by: Alexandr Morozov <lk4d4@docker.com>
Upstream-commit: e45bf8d2e9b43a4f5c5ed844b333733f95ccbafb
Component: engine
2015-04-06 13:40:56 -07:00
b38d23a637 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>
Upstream-commit: 5fa3a6f2482521d5731c43e076926f2f5318aa94
Component: engine
2015-04-06 13:39:02 -07:00
286897aa48 Test events streaming, fixes #12079
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
Upstream-commit: d1c4439b5aa9bfc6767372b64e3f3a1fdb7f7b65
Component: engine
2015-04-06 19:00:17 +02:00
a714c4cf33 Merge pull request #12107 from cpuguy83/remove_striptrailingchars
Remove `stripTrailingCharacters` from tests
Upstream-commit: b9d2ede4d4dc67b97abd0254a9e431aa9c89b932
Component: engine
2015-04-06 08:46:08 -07:00
ab9a366f0e Remove stripTrailingCharacters from tests
This was just an alias to `strings.TrimSpace`

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Upstream-commit: 475c65319b4663d630711519e18d0b134c42c7f1
Component: engine
2015-04-06 09:21:18 -04:00
efa6b62065 Merge pull request #11571 from noironetworks/11555-Docker-since-beginning-of-unix-time-doesnt-work
Fixes docker events since beginning of unix time
Upstream-commit: 9c505c906d318df7b5e8652c37e4df06b4f30d56
Component: engine
2015-04-02 15:03:04 -07:00
d25b9e78b6 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>
Upstream-commit: 8f7ac20bacfa6964ea830bfc6dfd4fc8c66bc9c3
Component: engine
2015-04-01 18:14:59 +01:00
562a382719 Fix random bug in cli events test
Signed-off-by: Mabin <bin.ma@huawei.com>
Upstream-commit: e15c3e36cc5559c3ec17179d8740b2841709daf5
Component: engine
2015-04-01 11:00:01 +08:00
4f989f959c Use common code to test all events, when using filter that expect all lifecycle events.
Addresses: #10654

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: f5ad895ba624b6baddfa0c54a2da439b41b0535f
Component: engine
2015-03-27 02:47:46 +00:00
35acd2c3eb Add fixes for integration-cli tests w/ --net none
Adds network to integration tests that were failing without network.

Fixes #10964
Fixes #10968

Signed-off-by: Jake Champlin <jake.champlin.27@gmail.com>
Upstream-commit: c2fe26243906ad2641876e877d23a419bb4bdb75
Component: engine
2015-03-25 23:46:04 -04:00
76ab368c1d integ-cli: fix clock skew against remote test daemon
This fixes the `docker events`-related tests as they have been
failing due to clock skew between CI machine and test daemon on
some other machine (even 1-2 seconds of diff causes races as
we pass local time to --since/--until).

If we're running in same host, we keep using time.Now(), otherwise
we read the system time of the daemon from `/info` endpoint.

Fixes pretty much all events-related tests on windows CI.

Signed-off-by: Ahmet Alp Balkan <ahmetalpbalkan@gmail.com>
Upstream-commit: e424c54d9c4030dc3290701e8e76add372e09e08
Component: engine
2015-03-11 10:28:56 -07:00
b83b16e3f8 filter events by container name,id or partial id
Addresses #10645

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: e0fa57737879681a8888de992eb6d2f0e624da74
Component: engine
2015-03-06 19:54:57 +00:00
b803f84438 Merge pull request #10675 from brahmaroutu/events_filterbyimage_10645
Allow use of just image name without the tag
Upstream-commit: c94eb28af02c85529cd54342c6ad4fe05120005b
Component: engine
2015-03-06 13:38:41 -05:00
2d903c82e5 Merge pull request #10798 from ahmetalpbalkan/win-cli/TestEventsUntag-fix
integration-cli: Remove timeout dependency on TestEventsUntag
Upstream-commit: a8b699f5d9a409702fd85a91f87f05f6bab267ed
Component: engine
2015-03-04 03:54:33 -08:00
c51839e44d Allow use of just image name without the tag
Addresses #10645

Signed-off-by: Srini Brahmaroutu <srbrahma@us.ibm.com>
Upstream-commit: ce02578317d03ea04f40416db96b679a55b55451
Component: engine
2015-03-03 22:38:45 +00:00
15ea5ae8fb fix racy events test
Docker-DCO-1.1-Signed-off-by: Jessie Frazelle <jess@docker.com> (github: jfrazelle)
Upstream-commit: 202709d178a24bcbfac223f0bcd9c4eda669e928
Component: engine
2015-02-27 14:48:39 -08:00