-
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
feature: finish restart interface #944
feature: finish restart interface #944
Conversation
there is a problem: If start container too quickly after stop it, the snapshot of the container will be deleted by the containerd gc. this pr should not be merged utill i fix the problem |
Codecov Report
@@ Coverage Diff @@
## master #944 +/- ##
==========================================
- Coverage 13.16% 13.12% -0.04%
==========================================
Files 123 123
Lines 8175 8197 +22
==========================================
Hits 1076 1076
- Misses 7003 7025 +22
Partials 96 96
Continue to review full report at Codecov.
|
0531fec
to
eb94d36
Compare
i have figured it out: when stopping a container we should add lease in ctx to prevent the snapshot being deleted by gc. |
Signed-off-by: Michael Wan <zirenwan@gmail.com>
eb94d36
to
59fa836
Compare
if err := mgr.stop(ctx, c, timeout); err != nil { | ||
return errors.Wrapf(err, "failed to stop container") | ||
} | ||
logrus.Debug("Restart: container " + c.ID() + " stopped succeeded") |
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.
we usually use logrus.Debugf()
here.
LGTM |
Signed-off-by: Michael Wan zirenwan@gmail.com
Ⅰ. Describe what this PR did
finish restart interface daemon part
Ⅱ. Does this pull request fix one issue?
Ⅲ. Describe how you did it
Ⅳ. Describe how to verify it
Ⅴ. Special notes for reviews