summaryrefslogtreecommitdiffhomepage
path: root/runsc/container
diff options
context:
space:
mode:
authorLantao Liu <lantaol@google.com>2018-06-25 12:07:50 -0700
committerShentubot <shentubot@google.com>2018-06-25 12:08:44 -0700
commite8ae2b85e90fc27e74de032698224e7972673cec (patch)
treee67bf03a17dc48b473a9ae9639d4aa35aefda3ab /runsc/container
parentcecc1e472cc893738a070be00d303dd888b9f325 (diff)
runsc: add a `multi-container` flag to enable multi-container support.
PiperOrigin-RevId: 201995800 Change-Id: I770190d135e14ec7da4b3155009fe10121b2a502
Diffstat (limited to 'runsc/container')
-rw-r--r--runsc/container/container.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/runsc/container/container.go b/runsc/container/container.go
index 9c0169ca8..428aa5c62 100644
--- a/runsc/container/container.go
+++ b/runsc/container/container.go
@@ -218,7 +218,7 @@ func Create(id string, spec *specs.Spec, conf *boot.Config, bundleDir, consoleSo
// started in an existing sandbox, we must do so. The metadata will
// indicate the ID of the sandbox, which is the same as the ID of the
// init container in the sandbox.
- if specutils.ShouldCreateSandbox(spec) {
+ if specutils.ShouldCreateSandbox(spec) || !conf.MultiContainer {
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.
@@ -287,7 +287,7 @@ func (c *Container) Start(conf *boot.Config) error {
}
}
- if specutils.ShouldCreateSandbox(c.Spec) {
+ if specutils.ShouldCreateSandbox(c.Spec) || !conf.MultiContainer {
if err := c.Sandbox.StartRoot(c.Spec, conf); err != nil {
c.Destroy()
return err