Merge pull request #10133 from AkihiroSuda/fix-10062

cri: introspectRuntimeFeatures: fix nil panic
This commit is contained in:
Akihiro Suda
2024-04-25 08:28:09 +00:00
committed by GitHub

View File

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