-
Notifications
You must be signed in to change notification settings - Fork 949
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: set pid of stopped container to 0 #2193
Conversation
@@ -126,3 +126,21 @@ func (suite *PouchStopSuite) TestStopMultiContainers(c *check.C) { | |||
c.Assert(string(result[0].State.Status), check.Equals, "stopped") | |||
|
|||
} | |||
|
|||
// TestStopPidValue ensure stopped container's pid is 0 | |||
func (suite *PouchStopSuite) TestStopPidValue(c *check.C) { |
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.
please add one case for the process exits by itself.
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.
make sense
Signed-off-by: Michael Wan <[email protected]>
b2408ba
to
e52903a
Compare
LGTM |
You have filled up the beautiful pull request description. @HusterWan |
Codecov Report
@@ Coverage Diff @@
## master #2193 +/- ##
==========================================
+ Coverage 59.91% 64.97% +5.06%
==========================================
Files 209 209
Lines 16739 16739
==========================================
+ Hits 10029 10877 +848
+ Misses 5488 4515 -973
- Partials 1222 1347 +125
|
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.
LGTM
Signed-off-by: Michael Wan [email protected]
Ⅰ. Describe what this PR did
We set pid of stopped container to
-1
before, it's ok that we do not check value of pid but the status of container when we want to check whether the container is stopped or not.But now,
pouchd
supportedCRI
, the k8s will check the value of pid when the container stopped and the pid is0
when container stopped.So, in order to stay with moby and kubernetes, we also should change the pid to
0
when the container is stopped.Ⅱ. Does this pull request fix one issue?
none
Ⅲ. Why don't you add test cases (unit test/integration test)? (你真的觉得不需要加测试吗?)
added
TestStopPidValue
test caseⅣ. Describe how to verify it
Ⅴ. Special notes for reviews
None