Implement proper shutdown logic
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
parent
a10aa91051
commit
c10b3cde9f
6 changed files with 67 additions and 20 deletions
|
@ -325,9 +325,13 @@ func (s *server) createCheckpoint(w http.ResponseWriter, r *http.Request) {
|
|||
name = vars["name"]
|
||||
)
|
||||
var cp Checkpoint
|
||||
if err := json.NewDecoder(r.Body).Decode(&cp); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
// most options to the checkpoint action can be left out so don't
|
||||
// decode unless the client passed anything in the body.
|
||||
if r.ContentLength > 0 {
|
||||
if err := json.NewDecoder(r.Body).Decode(&cp); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusBadRequest)
|
||||
return
|
||||
}
|
||||
}
|
||||
e := containerd.NewEvent(containerd.CreateCheckpointEventType)
|
||||
e.ID = id
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue