Skip to content

Commit 569af34

Browse files
jfernandezk8s-infra-cherrypick-robot
authored andcommitted
Prefer runtime options for PluginInfo request
Previously, PluginInfo was called with task options as the primary value, resulting in opts.BinaryName being omitted. Consequently, the containerd-shim-runc-v2 fell back to the system's runc binary in the PATH rather than the explicitly specified one. This change inverts the option fallback by preferring runtime options over task options, ensuring the correct binary is used for the PluginInfo request. Closes: #11169 Signed-off-by: Jose Fernandez <[email protected]> Reviewed-by: Erikson Tung <[email protected]>
1 parent 968d945 commit 569af34

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

core/runtime/v2/task_manager.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,12 @@ func (m *TaskManager) validateRuntimeFeatures(ctx context.Context, opts runtime.
266266
return nil
267267
}
268268

269-
topts := opts.TaskOptions
270-
if topts == nil || topts.GetValue() == nil {
271-
topts = opts.RuntimeOptions
269+
ropts := opts.RuntimeOptions
270+
if ropts == nil || ropts.GetValue() == nil {
271+
ropts = opts.TaskOptions
272272
}
273273

274-
pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: typeurl.MarshalProto(topts)})
274+
pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: typeurl.MarshalProto(ropts)})
275275
if err != nil {
276276
return fmt.Errorf("runtime info: %w", err)
277277
}

0 commit comments

Comments
 (0)