Skip to content

Commit faf2781

Browse files
committed
linux: propagate --runtime-root to shim properly
Signed-off-by: Akihiro Suda <[email protected]>
1 parent f334749 commit faf2781

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

linux/bundle.go

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,14 @@ type bundle struct {
8585
type ShimOpt func(*bundle, string, *runctypes.RuncOptions) (shim.Config, client.Opt)
8686

8787
// ShimRemote is a ShimOpt for connecting and starting a remote shim
88-
func ShimRemote(shimBinary, daemonAddress, cgroup string, debug bool, exitHandler func()) ShimOpt {
88+
func ShimRemote(c *Config, daemonAddress, cgroup string, exitHandler func()) ShimOpt {
8989
return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
90-
return b.shimConfig(ns, ropts),
91-
client.WithStart(shimBinary, b.shimAddress(ns), daemonAddress, cgroup, debug, exitHandler)
90+
config := b.shimConfig(ns, ropts)
91+
if config.RuntimeRoot == "" {
92+
config.RuntimeRoot = c.RuntimeRoot
93+
}
94+
return config,
95+
client.WithStart(c.Shim, b.shimAddress(ns), daemonAddress, cgroup, c.ShimDebug, exitHandler)
9296
}
9397
}
9498

linux/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
224224
}).Warn("failed to clen up after killed shim")
225225
}
226226
}
227-
shimopt = ShimRemote(r.config.Shim, r.address, cgroup, r.config.ShimDebug, exitHandler)
227+
shimopt = ShimRemote(r.config, r.address, cgroup, exitHandler)
228228
}
229229

230230
s, err := bundle.NewShimClient(ctx, namespace, shimopt, ropts)

0 commit comments

Comments
 (0)