-
Notifications
You must be signed in to change notification settings - Fork 950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bugfix: distinct init process exit and exec process exit #2347
bugfix: distinct init process exit and exec process exit #2347
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2347 +/- ##
==========================================
+ Coverage 66.57% 68.09% +1.51%
==========================================
Files 265 265
Lines 18209 18213 +4
==========================================
+ Hits 12123 12402 +279
+ Misses 4682 4389 -293
- Partials 1404 1422 +18
|
Could you add some integration test to cover this kind of distinguish? @HusterWan |
containerID = exitEvent.ContainerID | ||
attributes["exitcode"] = strconv.Itoa(int(exitEvent.ExitStatus)) | ||
attributes["exitCode"] = strconv.Itoa(int(exitEvent.ExitStatus)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why to make this exitcode uppercase? Will this bring some compatible issues for some early adopters? @HusterWan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have confirmed with other adopters that used the events policy of pouchd, they had done compability with the exitCode
.
So in order to stay with moby, i change the exitcode
to exitCode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will add the event
document later
37835c0
to
9926f54
Compare
@allencloud test cases added |
if exitEvent.ID == exitEvent.ContainerID { | ||
action = "die" | ||
} else { | ||
action = "exec_die" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In swagger.yml, we defined the /events API like the following:
/events:
get:
summary: "Subscribe pouchd events to users"
description: |
Stream real-time events from the server.
Report various object events of pouchd when something happens to them.
Containers report these events: create`, `destroy`, `die`, `oom`, `pause`, `rename`, `resize`, `restart`, `start`, `stop`, `top`, `unpause`, and `update`
Images report these events: `pull`, `untag`
Volumes report these events: `create`, `destroy`
Networks report these events: `create`, `connect`, `disconnect`, `destroy`
But here, I a afraid that we are adding another event type for container : exec's exec_die, right?
While this has not been collected in to API illustration. If we need to add this in swagger.yml, we should fix that. @HusterWan
And maybe we could have a very thorough thinking for the all workflow of the change: API, daemon, containerd, doc, test and some others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great advise, i will update this or soon
LGTM until the API swagger.yml has updated if necessary. |
Signed-off-by: Michael Wan <zirenwan@gmail.com>
9926f54
to
f87c632
Compare
I will merge this soon, while I still have some confusion. |
@allencloud I will support all import event types later that will help us know what |
Signed-off-by: Michael Wan zirenwan@gmail.com
Ⅰ. Describe what this PR did
Fix the process
exit
events not distinct theexec
process exit and the container exit.Now when a container exit we got events below:
when we execute an exec command, also got a container
die
event:Ⅱ. Does this pull request fix one issue?
none
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
add
TestExecDieEventWorks
,TestDieEventWorks
casesⅣ. Describe how to verify it
Ⅴ. Special notes for reviews
none