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

@@ -363,7 +363,7 @@ func (t *task) Exec(ctx context.Context, id string, spec *specs.Process, ioCreat
i.Close()
}
}()
pSpec, err := protobuf.MarshalAnyToProto(spec)
pSpec, err := typeurl.MarshalAnyToProto(spec)
if err != nil {
return nil, err
}
@@ -463,7 +463,7 @@ func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointTaskOpts) (Imag
}
request.ParentCheckpoint = i.ParentCheckpoint.String()
if i.Options != nil {
o, err := protobuf.MarshalAnyToProto(i.Options)
o, err := typeurl.MarshalAnyToProto(i.Options)
if err != nil {
return nil, err
}
@@ -552,7 +552,7 @@ func (t *task) Update(ctx context.Context, opts ...UpdateTaskOpts) error {
if err != nil {
return err
}
request.Resources = protobuf.FromAny(r)
request.Resources = typeurl.MarshalProto(r)
}
if i.Annotations != nil {
request.Annotations = i.Annotations