diff options
author | Brielle Broder <bbroder@google.com> | 2018-06-22 09:40:21 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-06-22 09:41:26 -0700 |
commit | e1aee51d09d650cca8d098050665c2d49d859e26 (patch) | |
tree | 65154bb7f61bab88916fb4bf32770e87c1a4622f /runsc/cmd/restore.go | |
parent | 0e434b66a625b937d90e4ebe632de4546101be5a (diff) |
Modified Checkpoint/Restore flags to improve compatibility with Docker.
Added a number of unimplemented flags required for using runsc's
Checkpoint and Restore with Docker. Modified the "image-path" flag to
require a directory instead of a file.
PiperOrigin-RevId: 201697486
Change-Id: I55883df2f1bbc3ec3c395e0ca160ce189e5e7eba
Diffstat (limited to 'runsc/cmd/restore.go')
-rw-r--r-- | runsc/cmd/restore.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/runsc/cmd/restore.go b/runsc/cmd/restore.go index 0589a36bf..cc55beeaf 100644 --- a/runsc/cmd/restore.go +++ b/runsc/cmd/restore.go @@ -15,6 +15,7 @@ package cmd import ( + "path/filepath" "syscall" "context" @@ -53,7 +54,17 @@ func (*Restore) Usage() string { // SetFlags implements subcommands.Command.SetFlags. func (r *Restore) SetFlags(f *flag.FlagSet) { r.Create.SetFlags(f) - f.StringVar(&r.imagePath, "image-path", "", "path to saved container image") + f.StringVar(&r.imagePath, "image-path", "", "directory path to saved container image") + + // Unimplemented flags necessary for compatibility with docker. + var d bool + f.BoolVar(&d, "detach", false, "ignored") + + var nsr bool + f.BoolVar(&nsr, "no-subreaper", false, "ignored") + + var wp string + f.StringVar(&wp, "work-path", "", "ignored") } // Execute implements subcommands.Command.Execute. @@ -81,7 +92,9 @@ func (r *Restore) Execute(_ context.Context, f *flag.FlagSet, args ...interface{ Fatalf("image-path flag must be provided") } - cont, err := container.Create(id, spec, conf, bundleDir, r.consoleSocket, r.pidFile, r.imagePath) + restoreFile := filepath.Join(r.imagePath, checkpointFileName) + + cont, err := container.Create(id, spec, conf, bundleDir, r.consoleSocket, r.pidFile, restoreFile) if err != nil { Fatalf("error restoring container: %v", err) } |