-
Notifications
You must be signed in to change notification settings - Fork 948
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: add stop command and recover container #30
Conversation
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 left some comments. PTAL
apis/server/container_bridge.go
Outdated
} | ||
|
||
func (s *Server) stopContainer(ctx context.Context, resp http.ResponseWriter, req *http.Request) error { | ||
t, _ := strconv.Atoi(req.FormValue("t")) |
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 do not think we can ignore the error here. Here is my reason:
This function is handling restful API. If a user uses http pure request "t=asdfg" which is invalid to access daemon, we had better throw out the error rather than make this move on.
daemon/mgr/container.go
Outdated
} | ||
|
||
// name is the container's prefix of the id. | ||
if !ok { |
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 can eliminate the if with an else
with the above if
.
Ok, I updated again. @allencloud |
Another thing, from the very beginning, is it necessary for us to take #32 into consideration? |
About the status code, I agree with you. @allencloud |
"./pouch stop ID" be used to stop a running container. When restart the pouchd, will recover these running containers. Signed-off-by: skoo87 <marckywu@gmail.com>
LGTM |
"./pouch stop ID" be used to stop a running container. When restart the
pouchd, will recover these running containers.
Signed-off-by: skoo87 marckywu@gmail.com