From 2e0fef51b3928337ef46629b4627ff1700a918d1 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 8 May 2019 13:44:06 +0200 Subject: migrate: not create a new namespace this leaves the containers stopped but we won't risk to use the wrong user namespace. Signed-off-by: Giuseppe Scrivano --- libpod/runtime.go | 12 ------------ libpod/runtime_migrate.go | 9 ++------- 2 files changed, 2 insertions(+), 19 deletions(-) (limited to 'libpod') diff --git a/libpod/runtime.go b/libpod/runtime.go index 18e9dfeb3..f9b34e315 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -966,18 +966,6 @@ func makeRuntime(ctx context.Context, runtime *Runtime) (err error) { runtime.valid = true if runtime.doMigrate { - if os.Geteuid() != 0 { - aliveLock.Unlock() - locked = false - - became, ret, err := rootless.BecomeRootInUserNS() - if err != nil { - return err - } - if became { - os.Exit(ret) - } - } if err := runtime.migrate(ctx); err != nil { return err } diff --git a/libpod/runtime_migrate.go b/libpod/runtime_migrate.go index 0bb8e952f..116885d3a 100644 --- a/libpod/runtime_migrate.go +++ b/libpod/runtime_migrate.go @@ -2,6 +2,7 @@ package libpod import ( "context" + "fmt" "path/filepath" "github.com/pkg/errors" @@ -21,7 +22,7 @@ func (r *Runtime) migrate(ctx context.Context) error { logrus.Infof("stopping all containers") for _, ctr := range runningContainers { - logrus.Infof("stopping %s", ctr.ID()) + fmt.Printf("stopped %s\n", ctr.ID()) if err := ctr.Stop(); err != nil { return errors.Wrapf(err, "cannot stop container %s", ctr.ID()) } @@ -38,11 +39,5 @@ func (r *Runtime) migrate(ctx context.Context) error { } } - for _, ctr := range runningContainers { - if err := ctr.Start(ctx, true); err != nil { - logrus.Errorf("error restarting container %s", ctr.ID()) - } - } - return nil } -- cgit v1.2.3-54-g00ecf