MCPcopy
hub / github.com/containerd/containerd / Start

Method Start

client/task.go:249–269  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

247}
248
249func (t *task) Start(ctx context.Context) error {
250 ctx, span := tracing.StartSpan(ctx, tracing.Name("client.task", "Start"),
251 tracing.WithAttribute("task.id", t.ID()),
252 tracing.WithNamespace(ctx),
253 )
254 defer span.End()
255
256 r, err := t.client.TaskService().Start(ctx, &tasks.StartRequest{
257 ContainerID: t.id,
258 })
259 if err != nil {
260 if t.io != nil {
261 t.io.Cancel()
262 t.io.Close()
263 }
264 return errgrpc.ToNative(err)
265 }
266 span.SetAttributes(tracing.Attribute("task.pid", r.Pid))
267 t.pid = r.Pid
268 return nil
269}
270
271func (t *task) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts) error {
272 ctx, span := tracing.StartSpan(ctx, tracing.Name("client.task", "Kill"),

Callers

nothing calls this directly

Calls 12

IDMethod · 0.95
StartSpanFunction · 0.92
NameFunction · 0.92
WithAttributeFunction · 0.92
WithNamespaceFunction · 0.92
AttributeFunction · 0.92
EndMethod · 0.80
TaskServiceMethod · 0.80
SetAttributesMethod · 0.80
StartMethod · 0.65
CancelMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected