Merge pull request #2173 from AkihiroSuda/fix-shim-runtime-root

linux: propagate --runtime-root to shim properly
This commit is contained in:
Phil Estes 2018-02-28 13:17:28 -05:00 committed by GitHub
commit b3a4e63c69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -85,10 +85,14 @@ type bundle struct {
type ShimOpt func(*bundle, string, *runctypes.RuncOptions) (shim.Config, client.Opt) type ShimOpt func(*bundle, string, *runctypes.RuncOptions) (shim.Config, client.Opt)
// ShimRemote is a ShimOpt for connecting and starting a remote shim // 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 func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
return b.shimConfig(ns, ropts), config := b.shimConfig(ns, ropts)
client.WithStart(shimBinary, b.shimAddress(ns), daemonAddress, cgroup, debug, exitHandler) if config.RuntimeRoot == "" {
config.RuntimeRoot = c.RuntimeRoot
}
return config,
client.WithStart(c.Shim, b.shimAddress(ns), daemonAddress, cgroup, c.ShimDebug, exitHandler)
} }
} }

View File

@ -224,7 +224,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
}).Warn("failed to clen up after killed shim") }).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) s, err := bundle.NewShimClient(ctx, namespace, shimopt, ropts)