Skip to content

Commit 6646106

Browse files
AkihiroSudakunalkushwaha
authored andcommitted
linux: propagate --runtime-root to shim properly
Signed-off-by: Akihiro Suda <[email protected]>
1 parent 9b4bbcc commit 6646106

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
@@ -69,10 +69,14 @@ type bundle struct {
6969
type ShimOpt func(*bundle, string, *runctypes.RuncOptions) (shim.Config, client.Opt)
7070

7171
// ShimRemote is a ShimOpt for connecting and starting a remote shim
72-
func ShimRemote(shimBinary, daemonAddress, cgroup string, debug bool, exitHandler func()) ShimOpt {
72+
func ShimRemote(c *Config, daemonAddress, cgroup string, exitHandler func()) ShimOpt {
7373
return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
74-
return b.shimConfig(ns, ropts),
75-
client.WithStart(shimBinary, b.shimAddress(ns), daemonAddress, cgroup, debug, exitHandler)
74+
config := b.shimConfig(ns, ropts)
75+
if config.RuntimeRoot == "" {
76+
config.RuntimeRoot = c.RuntimeRoot
77+
}
78+
return config,
79+
client.WithStart(c.Shim, b.shimAddress(ns), daemonAddress, cgroup, c.ShimDebug, exitHandler)
7680
}
7781
}
7882

linux/runtime.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
208208
}).Warn("failed to clen up after killed shim")
209209
}
210210
}
211-
shimopt = ShimRemote(r.config.Shim, r.address, cgroup, r.config.ShimDebug, exitHandler)
211+
shimopt = ShimRemote(r.config, r.address, cgroup, exitHandler)
212212
}
213213

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

0 commit comments

Comments
 (0)