From 525f0b30ac280565a1f98fd4208821a4984a7515 Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Mon, 15 Apr 2019 22:03:47 +0200 Subject: system: add new subcommand "migrate" it is useful to migrate existing containers to a new version of podman. Currently, it is needed to migrate rootless containers that were created with podman <= 1.2 to a newer version which requires all containers to be running in the same user namespace. Closes: https://github.com/containers/libpod/issues/2935 Signed-off-by: Giuseppe Scrivano --- libpod/options.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libpod/options.go') diff --git a/libpod/options.go b/libpod/options.go index 8038f1935..949894dcb 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -436,6 +436,22 @@ func WithRenumber() RuntimeOption { } } +// WithMigrate instructs libpod to perform a lock migrateing while +// initializing. This will handle migrations from early versions of libpod with +// file locks to newer versions with SHM locking, as well as changes in the +// number of configured locks. +func WithMigrate() RuntimeOption { + return func(rt *Runtime) error { + if rt.valid { + return ErrRuntimeFinalized + } + + rt.doMigrate = true + + return nil + } +} + // Container Creation Options // WithShmDir sets the directory that should be mounted on /dev/shm. -- cgit v1.2.3-54-g00ecf