cri: introspectRuntimeFeatures: fix nil panic

Fix issue 10062

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda 2024-04-25 08:36:38 +09:00
parent 01ed3ff123
commit c27bcdc564
No known key found for this signature in database
GPG Key ID: 49524C6F9F638F1A

View File

@ -409,10 +409,12 @@ func introspectRuntimeFeatures(ctx context.Context, intro introspection.Service,
if err != nil {
return nil, err
}
if options != nil {
rr.Options, err = protobuf.MarshalAnyToProto(options)
if err != nil {
return nil, fmt.Errorf("failed to marshal %T: %w", options, err)
}
}
infoResp, err := intro.PluginInfo(ctx, string(plugins.RuntimePluginV2), "task", rr)
if err != nil {