From 2478e32ca334692dd18c4534c1f9b2a6a2c296cf Mon Sep 17 00:00:00 2001 From: cdoern Date: Thu, 22 Sep 2022 15:05:43 -0400 Subject: [PATCH] fix restore API endpoint 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 #15018 Signed-off-by: cdoern --- pkg/api/handlers/libpod/containers.go | 2 ++ pkg/api/server/register_containers.go | 4 ++++ test/e2e/checkpoint_test.go | 4 ---- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/api/handlers/libpod/containers.go b/pkg/api/handlers/libpod/containers.go index 854740b17a..9d18c9420f 100644 --- a/pkg/api/handlers/libpod/containers.go +++ b/pkg/api/handlers/libpod/containers.go @@ -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 } @@ -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 diff --git a/pkg/api/server/register_containers.go b/pkg/api/server/register_containers.go index 311eecd177..2cf5169ba0 100644 --- a/pkg/api/server/register_containers.go +++ b/pkg/api/server/register_containers.go @@ -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: diff --git a/test/e2e/checkpoint_test.go b/test/e2e/checkpoint_test.go index a339365495..b0c1d36d36 100644 --- a/test/e2e/checkpoint_test.go +++ b/test/e2e/checkpoint_test.go @@ -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.") }