From c27bcdc564840077b24e1930721ec7c95b1ca242 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 25 Apr 2024 08:36:38 +0900 Subject: [PATCH] cri: introspectRuntimeFeatures: fix nil panic Fix issue 10062 Signed-off-by: Akihiro Suda --- internal/cri/server/service.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/internal/cri/server/service.go b/internal/cri/server/service.go index ee00769f4..5e4ed52c9 100644 --- a/internal/cri/server/service.go +++ b/internal/cri/server/service.go @@ -409,9 +409,11 @@ func introspectRuntimeFeatures(ctx context.Context, intro introspection.Service, if err != nil { return nil, err } - rr.Options, err = protobuf.MarshalAnyToProto(options) - if err != nil { - return nil, fmt.Errorf("failed to marshal %T: %w", options, 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)