prefer task options for PluginInfo request

Signed-off-by: Iceber Gu <caiwei95@hotmail.com>
This commit is contained in:
Iceber Gu 2025-03-26 14:59:17 +08:00 committed by k8s-infra-cherrypick-robot
parent a183b2d232
commit 8a16a6a04a

View File

@ -266,12 +266,12 @@ func (m *TaskManager) validateRuntimeFeatures(ctx context.Context, opts runtime.
return nil return nil
} }
ropts := opts.RuntimeOptions topts := opts.TaskOptions
if ropts == nil || ropts.GetValue() == nil { if topts == nil || topts.GetValue() == nil {
ropts = opts.TaskOptions topts = opts.RuntimeOptions
} }
pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: typeurl.MarshalProto(ropts)}) pInfo, err := m.PluginInfo(ctx, &apitypes.RuntimeRequest{RuntimePath: opts.Runtime, Options: typeurl.MarshalProto(topts)})
if err != nil { if err != nil {
return fmt.Errorf("runtime info: %w", err) return fmt.Errorf("runtime info: %w", err)
} }