use typeurl funcs for marshalling anypb.Any

Signed-off-by: Akhil Mohan <akhilerm@gmail.com>
This commit is contained in:
Akhil Mohan
2024-07-08 21:48:31 +05:30
parent cbb2fc78e9
commit 300fd770a0
36 changed files with 109 additions and 164 deletions

View File

@@ -461,7 +461,7 @@ func (l *local) ListPids(ctx context.Context, r *api.ListPidsRequest, _ ...grpc.
Pid: p.Pid,
}
if p.Info != nil {
a, err := protobuf.MarshalAnyToProto(p.Info)
a, err := typeurl.MarshalAnyToProto(p.Info)
if err != nil {
return nil, fmt.Errorf("failed to marshal process %d info: %w", p.Pid, err)
}
@@ -576,7 +576,7 @@ func (l *local) Checkpoint(ctx context.Context, r *api.CheckpointTaskRequest, _
return nil, err
}
// write the config to the content store
pbany := protobuf.FromAny(container.Spec)
pbany := typeurl.MarshalProto(container.Spec)
data, err := proto.Marshal(pbany)
if err != nil {
return nil, err