Skip to content

Commit

Permalink
fix restore API endpoint
Browse files Browse the repository at this point in the history
restore endpoint was totally ignoring --pod, it was missing from the schema and from query handling
on the api handlers side. add support for it here.

resolves containers#15018

Signed-off-by: cdoern <[email protected]>
  • Loading branch information
cdoern committed Sep 22, 2022
1 parent 0899351 commit 2478e32
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions pkg/api/handlers/libpod/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ func Restore(w http.ResponseWriter, r *http.Request) {
PrintStats bool `schema:"printStats"`
FileLocks bool `schema:"fileLocks"`
PublishPorts string `schema:"publishPorts"`
Pod string `schema:"pod"`
}{
// override any golang type defaults
}
Expand All @@ -324,6 +325,7 @@ func Restore(w http.ResponseWriter, r *http.Request) {
PrintStats: query.PrintStats,
FileLocks: query.FileLocks,
PublishPorts: strings.Fields(query.PublishPorts),
Pod: query.Pod,
}

var names []string
Expand Down
4 changes: 4 additions & 0 deletions pkg/api/server/register_containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -1516,6 +1516,10 @@ func (s *APIServer) registerContainersHandlers(r *mux.Router) error {
// name: printStats
// type: boolean
// description: add restore statistics to the returned RestoreReport
// - in: query
// name: pod
// type: string
// description: pod to restore into
// produces:
// - application/json
// responses:
Expand Down
4 changes: 0 additions & 4 deletions test/e2e/checkpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1170,10 +1170,6 @@ var _ = Describe("Podman checkpoint", func() {
share := share // copy into local scope, for use inside function

It(testName, func() {
if podmanTest.Host.Distribution == "ubuntu" && IsRemote() {
Skip("FIXME: #15018. Cannot restore --pod under cgroupsV1 and remote")
}

if !criu.CheckForCriu(criu.PodCriuVersion) {
Skip("CRIU is missing or too old.")
}
Expand Down

0 comments on commit 2478e32

Please sign in to comment.