summaryrefslogtreecommitdiffhomepage
path: root/runsc/container/container.go
diff options
context:
space:
mode:
authorBrielle Broder <bbroder@google.com>2018-06-21 09:57:33 -0700
committerShentubot <shentubot@google.com>2018-06-21 09:58:24 -0700
commit7d6149063a0bb6e563885a8f199756e7af5e69cf (patch)
tree44378246b5a4535184658b854066baa5b0bac6d0 /runsc/container/container.go
parent81d13fbd4d2f14b61e89faa0c9888be568f97168 (diff)
Restore implementation added to runsc.
Restore creates a new container and uses the given image-path to load a saved image of a previous container. Restore command is plumbed through container and sandbox. This command does not work yet - more to come. PiperOrigin-RevId: 201541229 Change-Id: I864a14c799ce3717d99bcdaaebc764281863d06f
Diffstat (limited to 'runsc/container/container.go')
-rw-r--r--runsc/container/container.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go
index 3b7f95af9..604708e2c 100644
--- a/runsc/container/container.go
+++ b/runsc/container/container.go
@@ -188,7 +188,7 @@ func List(rootDir string) ([]string, error) {
// Create creates the container in a new Sandbox process, unless the metadata
// indicates that an existing Sandbox should be used.
-func Create(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSocket, pidFile string) (*Container, error) {
+func Create(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSocket, pidFile string, restoreFile string) (*Container, error) {
log.Debugf("Create container %q in root dir: %s", id, conf.RootDir)
if err := validateID(id); err != nil {
return nil, err
@@ -222,7 +222,7 @@ func Create(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSo
log.Debugf("Creating new sandbox for container %q", id)
// Start a new sandbox for this container. Any errors after this point
// must destroy the container.
- s, err := sandbox.Create(id, spec, conf, bundleDir, consoleSocket)
+ s, err := sandbox.Create(id, spec, conf, bundleDir, consoleSocket, restoreFile)
if err != nil {
c.Destroy()
return nil, err
@@ -313,7 +313,7 @@ func (c *Container) Start(conf *boot.Config) error {
// Run is a helper that calls Create + Start + Wait.
func Run(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSocket, pidFile string) (syscall.WaitStatus, error) {
log.Debugf("Run container %q in root dir: %s", id, conf.RootDir)
- c, err := Create(id, spec, conf, bundleDir, consoleSocket, pidFile)
+ c, err := Create(id, spec, conf, bundleDir, consoleSocket, pidFile, "")
if err != nil {
return 0, fmt.Errorf("error creating container: %v", err)
}