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: https://github.com/containerd/containerd/issues/11169 Signed-off-by: Jose Fernandez <josef@netflix.com> Reviewed-by: Erikson Tung <etung@netflix.com>
This commit is contained in:
parent
968d9452ed
commit
569af34cbb
@ -266,12 +266,12 @@ func (m *TaskManager) validateRuntimeFeatures(ctx context.Context, opts runtime.
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
topts := opts.TaskOptions
|
ropts := opts.RuntimeOptions
|
||||||
if topts == nil || topts.GetValue() == nil {
|
if ropts == nil || ropts.GetValue() == nil {
|
||||||
topts = opts.RuntimeOptions
|
ropts = opts.TaskOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: typeurl.MarshalProto(topts)})
|
pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: typeurl.MarshalProto(ropts)})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("runtime info: %w", err)
|
return fmt.Errorf("runtime info: %w", err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user