closes #35702 introduce « exec_die » event#35744
Conversation
There was a problem hiding this comment.
Would be good to t.Fatal(err) here so we have more information about the failure.
There was a problem hiding this comment.
This should probably check the other fields of the event as well, at least the event name
|
Some lint issues; |
|
Can you also squash your commits? Changes look small enough to be in a single commit |
4a692ea to
cc13589
Compare
thaJeztah
left a comment
There was a problem hiding this comment.
I'd like to have a quick check with other maintainers tomorrow at the maintainers meeting, but overall this looks good 👍
There was a problem hiding this comment.
Generally, I think this PR looks good; I want to double check on this one with other maintainers. I think the other exec requests;
- have
exec_foo:<command and arguments>as event (this was actually a mistake, but we had to keep it for backward-compatibility, and still have to work on improving that) - do not have an
execIdproperty; I think it's useful, but wondering if we should see this as a separate feature, and also consider adding the attribute to otherexec_xxevents (so that events can be related to each other)
FWIW, there's some weird things still with the events endpoint (e.g. "custom attributes" and "actual attributes" are merged, and can "overlap"); something that should be looked at
|
Discussing in the maintainers meeting; can you add a second commit that adds the |
|
Thanks @ndeloof; overall this LGTM, but I have a couple of small things; Regarding However, it should likely be @ndeloof can you change;
Also, we should document properties in the swagger file. Looks like so far we didn't do so, so I'm ok with doing that separately in a follow-up (example event stream below) Details[
{
"status": "pull",
"id": "nginx:alpine",
"Type": "image",
"Action": "pull",
"Actor": {
"ID": "nginx:alpine",
"Attributes": {
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "nginx"
}
},
"scope": "local",
"time": 1514553990,
"timeNano": 1514553990091358700
},
{
"status": "create",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "create",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo"
}
},
"scope": "local",
"time": 1514553990,
"timeNano": 1514553990219607300
},
{
"Type": "network",
"Action": "connect",
"Actor": {
"ID": "1d402bbfdaf4adba234cd5c09e66127cc9066e05b383d80c5a8eb734521bbbcc",
"Attributes": {
"container": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"name": "bridge",
"type": "bridge"
}
},
"scope": "local",
"time": 1514553990,
"timeNano": 1514553990237711000
},
{
"status": "start",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "start",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo"
}
},
"scope": "local",
"time": 1514553990,
"timeNano": 1514553990660905000
},
{
"status": "exec_create: sh ",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "exec_create: sh ",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"execId": "526c1b75e58f8d66344894ecbf6645e53382ec261e3022b95211f53f959f3138",
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo"
}
},
"scope": "local",
"time": 1514554002,
"timeNano": 1514554002318149400
},
{
"status": "exec_start: sh ",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "exec_start: sh ",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"execId": "526c1b75e58f8d66344894ecbf6645e53382ec261e3022b95211f53f959f3138",
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo"
}
},
"scope": "local",
"time": 1514554002,
"timeNano": 1514554002319235000
},
{
"status": "exec_die",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "exec_die",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"execId": "526c1b75e58f8d66344894ecbf6645e53382ec261e3022b95211f53f959f3138",
"exitCode": "0",
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo"
}
},
"scope": "local",
"time": 1514554021,
"timeNano": 1514554021038903600
},
{
"status": "kill",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "kill",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo",
"signal": "9"
}
},
"scope": "local",
"time": 1514554062,
"timeNano": 1514554062808309000
},
{
"status": "die",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "die",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"exitCode": "137",
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo"
}
},
"scope": "local",
"time": 1514554063,
"timeNano": 1514554063068919300
},
{
"Type": "network",
"Action": "disconnect",
"Actor": {
"ID": "1d402bbfdaf4adba234cd5c09e66127cc9066e05b383d80c5a8eb734521bbbcc",
"Attributes": {
"container": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"name": "bridge",
"type": "bridge"
}
},
"scope": "local",
"time": 1514554063,
"timeNano": 1514554063337964000
},
{
"status": "destroy",
"id": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"from": "nginx:alpine",
"Type": "container",
"Action": "destroy",
"Actor": {
"ID": "9833812e5cd5abd48b4c55a10cb8276b1790cc142037971c534ba885b2307e05",
"Attributes": {
"image": "nginx:alpine",
"maintainer": "NGINX Docker Maintainers <[email protected]>",
"name": "foo"
}
},
"scope": "local",
"time": 1514554063,
"timeNano": 1514554063457728000
}
] |
|
@thaJeztah udpated to use "execID" as requested. |
|
Can you update the https://github.com/moby/moby/blob/master/docs/api/version-history.md as well? Then I think we'd be ready to merge 😅 |
|
oh, and squash commits where needed |
Signed-off-by: Nicolas De Loof <[email protected]>
|
Argh it's doing this again; Let me try to add a diff to that output (because we had the same problem last time) |
|
@vdemeester Please add an example of this to https://github.com/docker/cli/blob/master/docs/reference/commandline/events.md so that the docs will be updated. That will need to be cherry-picked into |
Signed-off-by: Nicolas De Loof [email protected]
- What I did
Implemented a new event "exec_die" when containerd report exec termination
- How I did it
execConfig is already updated in daemon, just added event logging
- How to verify it
events console will show "exec_die" event
- Description for the changelog
introduce new
exec_dieevent on exec termination- A picture of a cute animal (not mandatory but encouraged)