Merge pull request #11446 from k8s-infra-cherrypick-robot/cherry-pick-11442-to-release/2.0

[release/2.0] Prefer runtime options for PluginInfo request
This commit is contained in:
Akihiro Suda 2025-02-27 23:51:44 +09:00 committed by GitHub
commit 02b70eaa9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -266,12 +266,12 @@ func (m *TaskManager) validateRuntimeFeatures(ctx context.Context, opts runtime.
return nil
}
topts := opts.TaskOptions
if topts == nil || topts.GetValue() == nil {
topts = opts.RuntimeOptions
ropts := opts.RuntimeOptions
if ropts == nil || ropts.GetValue() == nil {
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 {
return fmt.Errorf("runtime info: %w", err)
}