WIP: add <object> events subcommands#3265
Draft
thaJeztah wants to merge 1 commit intodocker:masterfrom
Draft
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3265 +/- ##
==========================================
+ Coverage 58.96% 59.07% +0.11%
==========================================
Files 288 297 +9
Lines 24419 24373 -46
==========================================
Hits 14399 14399
+ Misses 9148 9102 -46
Partials 872 872 |
e8fb0a5 to
6da6a63
Compare
This adds `events` subcommand for objects that emit events. The following
subcommands have been added:
- `docker builder events`
- `docker container events`
- `docker image events`
- `docker network events`
- `docker plugin events`
- `docker volume events`
And if swarm-mode is enabled:
- `docker config events`
- `docker node events`
- `docker secret events`
- `docker service events`
For example:
docker container events --help
Usage: docker container events [OPTIONS]
Get real time container events from the server
Options:
-f, --filter filter Filter output based on conditions provided
--format string Format the output using the given Go template
--since string Show all events created since timestamp
--until string Stream events until this timestamp
Which allows for an easier way to get (e.g.) container events:
docker container events
2022-03-09T20:43:00.065147085Z container create 9bd0f04d0e5da85e14920e08a17dc1fd50f5350fbe0d54d22765f1ff8389a10d (image=hello-world, name=relaxed_wozniak)
2022-03-09T20:43:00.069350334Z container attach 9bd0f04d0e5da85e14920e08a17dc1fd50f5350fbe0d54d22765f1ff8389a10d (image=hello-world, name=relaxed_wozniak)
2022-03-09T20:43:00.322140439Z container start 9bd0f04d0e5da85e14920e08a17dc1fd50f5350fbe0d54d22765f1ff8389a10d (image=hello-world, name=relaxed_wozniak)
2022-03-09T20:43:00.329593970Z container resize 9bd0f04d0e5da85e14920e08a17dc1fd50f5350fbe0d54d22765f1ff8389a10d (height=35, image=hello-world, name=relaxed_wozniak, width=204)
2022-03-09T20:43:00.351286568Z container die 9bd0f04d0e5da85e14920e08a17dc1fd50f5350fbe0d54d22765f1ff8389a10d (exitCode=0, image=hello-world, name=relaxed_wozniak)
2022-03-09T20:43:00.419673665Z container destroy 9bd0f04d0e5da85e14920e08a17dc1fd50f5350fbe0d54d22765f1ff8389a10d (image=hello-world, name=relaxed_wozniak)
Which is the equivalent of:
docker events --filter type=container
2022-03-09T20:45:27.343518236Z container create 92ada3b7a6498a9ec6df1a4ee5868c4a99419bf3d7f34de880033c485304fe95 (image=hello-world, name=vibrant_grothendieck)
2022-03-09T20:45:27.346246258Z container attach 92ada3b7a6498a9ec6df1a4ee5868c4a99419bf3d7f34de880033c485304fe95 (image=hello-world, name=vibrant_grothendieck)
2022-03-09T20:45:27.611698530Z container start 92ada3b7a6498a9ec6df1a4ee5868c4a99419bf3d7f34de880033c485304fe95 (image=hello-world, name=vibrant_grothendieck)
2022-03-09T20:45:27.631348951Z container die 92ada3b7a6498a9ec6df1a4ee5868c4a99419bf3d7f34de880033c485304fe95 (exitCode=0, image=hello-world, name=vibrant_grothendieck)
2022-03-09T20:45:27.694625045Z container destroy 92ada3b7a6498a9ec6df1a4ee5868c4a99419bf3d7f34de880033c485304fe95 (image=hello-world, name=vibrant_grothendieck)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
eventssubcommand for objects that emit events. The following sub-commands have been added:
docker builder eventsdocker container eventsdocker image eventsdocker network eventsdocker plugin eventsdocker volume eventsAnd if swarm-mode is enabled:
docker config eventsdocker node eventsdocker secret eventsdocker service eventsFor example:
Which allows for an easier way to get (e.g.) container events:
Which is the equivalent of:
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)