Skip to content

Commit

Permalink
linux: propagate --runtime-root to shim properly
Browse files Browse the repository at this point in the history
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
  • Loading branch information
AkihiroSuda committed Feb 28, 2018
1 parent f334749 commit faf2781
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions linux/bundle.go
Expand Up @@ -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)
}
}

Expand Down
2 changes: 1 addition & 1 deletion linux/runtime.go
Expand Up @@ -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)
Expand Down

0 comments on commit faf2781

Please sign in to comment.