From faf2781dd2dbc61a39dbb6349fbd04b934ab9303 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 28 Feb 2018 04:40:57 +0900 Subject: [PATCH] linux: propagate --runtime-root to shim properly Signed-off-by: Akihiro Suda --- linux/bundle.go | 10 +++++++--- linux/runtime.go | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/linux/bundle.go b/linux/bundle.go index 735547c5c..67275ae0a 100644 --- a/linux/bundle.go +++ b/linux/bundle.go @@ -85,10 +85,14 @@ type bundle struct { type ShimOpt func(*bundle, string, *runctypes.RuncOptions) (shim.Config, client.Opt) // ShimRemote is a ShimOpt for connecting and starting a remote shim -func ShimRemote(shimBinary, daemonAddress, cgroup string, debug bool, exitHandler func()) ShimOpt { +func ShimRemote(c *Config, daemonAddress, cgroup string, exitHandler func()) ShimOpt { return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) { - return b.shimConfig(ns, ropts), - client.WithStart(shimBinary, b.shimAddress(ns), daemonAddress, cgroup, debug, exitHandler) + config := b.shimConfig(ns, ropts) + if config.RuntimeRoot == "" { + config.RuntimeRoot = c.RuntimeRoot + } + return config, + client.WithStart(c.Shim, b.shimAddress(ns), daemonAddress, cgroup, c.ShimDebug, exitHandler) } } diff --git a/linux/runtime.go b/linux/runtime.go index 1e1b77da7..9f2d49eba 100644 --- a/linux/runtime.go +++ b/linux/runtime.go @@ -224,7 +224,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts }).Warn("failed to clen up after killed shim") } } - shimopt = ShimRemote(r.config.Shim, r.address, cgroup, r.config.ShimDebug, exitHandler) + shimopt = ShimRemote(r.config, r.address, cgroup, exitHandler) } s, err := bundle.NewShimClient(ctx, namespace, shimopt, ropts)