summaryrefslogtreecommitdiff
path: root/cmd/podman/system_migrate.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-04-16 12:25:26 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-16 15:53:58 -0500
commit241326a9a8c20ad7f2bcf651416b836e7778e090 (patch)
tree4001e8e47a022bb1b9bfbf2332c42e1aeb802f9e /cmd/podman/system_migrate.go
parent88c6fd06cd54fb9a8826306dfdf1a77e400de5de (diff)
downloadpodman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.gz
podman-241326a9a8c20ad7f2bcf651416b836e7778e090.tar.bz2
podman-241326a9a8c20ad7f2bcf651416b836e7778e090.zip
Podman V2 birth
remote podman v1 and replace with podman v2. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'cmd/podman/system_migrate.go')
-rw-r--r--cmd/podman/system_migrate.go52
1 files changed, 0 insertions, 52 deletions
diff --git a/cmd/podman/system_migrate.go b/cmd/podman/system_migrate.go
deleted file mode 100644
index 9c90aeb52..000000000
--- a/cmd/podman/system_migrate.go
+++ /dev/null
@@ -1,52 +0,0 @@
-package main
-
-import (
- "github.com/containers/libpod/cmd/podman/cliconfig"
- "github.com/containers/libpod/cmd/podman/libpodruntime"
- "github.com/pkg/errors"
- "github.com/spf13/cobra"
-)
-
-var (
- migrateCommand cliconfig.SystemMigrateValues
- migrateDescription = `
- podman system migrate
-
- Migrate existing containers to a new version of Podman.
-`
-
- _migrateCommand = &cobra.Command{
- Use: "migrate",
- Args: noSubArgs,
- Short: "Migrate containers",
- Long: migrateDescription,
- RunE: func(cmd *cobra.Command, args []string) error {
- migrateCommand.InputArgs = args
- migrateCommand.GlobalFlags = MainGlobalOpts
- return migrateCmd(&migrateCommand)
- },
- }
-)
-
-func init() {
- migrateCommand.Command = _migrateCommand
- migrateCommand.SetHelpTemplate(HelpTemplate())
- migrateCommand.SetUsageTemplate(UsageTemplate())
- flags := migrateCommand.Flags()
- flags.StringVar(&migrateCommand.NewRuntime, "new-runtime", "", "Specify a new runtime for all containers")
-}
-
-func migrateCmd(c *cliconfig.SystemMigrateValues) error {
- // We need to pass one extra option to NewRuntime.
- // This will inform the OCI runtime to start a migrate.
- // That's controlled by the last argument to GetRuntime.
- r, err := libpodruntime.GetRuntimeMigrate(getContext(), &c.PodmanCommand, c.NewRuntime)
- if err != nil {
- return errors.Wrapf(err, "error migrating containers")
- }
- if err := r.Shutdown(false); err != nil {
- return err
- }
-
- return nil
-}