summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-11 19:56:13 +0200
committerGitHub <noreply@github.com>2019-10-11 19:56:13 +0200
commitcee6478f9e5e5cdbfe3df8f4894e416e4c5926e4 (patch)
tree2936df1d29e417d4ab4e7a22802ed75f31591acc /libpod/options.go
parenteb6ca054fc93e5f863581e72923cb1e80fc5ab88 (diff)
parentfeba94eb95f93fd571efff039cb7d7cdb5139169 (diff)
downloadpodman-cee6478f9e5e5cdbfe3df8f4894e416e4c5926e4.tar.gz
podman-cee6478f9e5e5cdbfe3df8f4894e416e4c5926e4.tar.bz2
podman-cee6478f9e5e5cdbfe3df8f4894e416e4c5926e4.zip
Merge pull request #4221 from mheon/reset_runtime
Migrate can move containers to a user-defined runtime
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go22
1 files changed, 22 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index ee44439ac..ddc5993af 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -463,6 +463,28 @@ func WithMigrate() RuntimeOption {
}
}
+// WithMigrateRuntime instructs Libpod to change the default OCI runtime on all
+// containers during a migration. This is not used if `MigrateRuntime()` is not
+// also passed.
+// Libpod makes no promises that your containers continue to work with the new
+// runtime - migrations between dissimilar runtimes may well break things.
+// Use with caution.
+func WithMigrateRuntime(requestedRuntime string) RuntimeOption {
+ return func(rt *Runtime) error {
+ if rt.valid {
+ return define.ErrRuntimeFinalized
+ }
+
+ if requestedRuntime == "" {
+ return errors.Wrapf(define.ErrInvalidArg, "must provide a non-empty name for new runtime")
+ }
+
+ rt.migrateRuntime = requestedRuntime
+
+ return nil
+ }
+}
+
// WithEventsLogger sets the events backend to use.
// Currently supported values are "file" for file backend and "journald" for
// journald backend.