Skip to content

Commit 97064b0

Browse files
committed
WithRuntimePath uses the TaskInfo.RuntimePath field
Signed-off-by: Iceber Gu <[email protected]>
1 parent 831b9a9 commit 97064b0

3 files changed

Lines changed: 7 additions & 1 deletion

File tree

container.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ func (c *container) NewTask(ctx context.Context, ioCreate cio.Creator, opts ...N
281281
})
282282
}
283283
}
284+
request.RuntimePath = info.RuntimePath
284285
if info.Options != nil {
285286
any, err := typeurl.MarshalAny(info.Options)
286287
if err != nil {

task.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ type TaskInfo struct {
139139
RootFS []mount.Mount
140140
// Options hold runtime specific settings for task creation
141141
Options interface{}
142+
// RuntimePath is an absolute path that can be used to overwrite path
143+
// to a shim runtime binary.
144+
RuntimePath string
145+
146+
// runtime is the runtime name for the container, and cannot be changed.
142147
runtime string
143148
}
144149

task_opts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func WithRootFS(mounts []mount.Mount) NewTaskOpts {
4848
// instead of resolving it from runtime name.
4949
func WithRuntimePath(absRuntimePath string) NewTaskOpts {
5050
return func(ctx context.Context, client *Client, info *TaskInfo) error {
51-
info.runtime = absRuntimePath
51+
info.RuntimePath = absRuntimePath
5252
return nil
5353
}
5454
}

0 commit comments

Comments
 (0)