MCPcopy
hub / github.com/containerd/containerd / Get

Method Get

plugins/services/tasks/local.go:406–424  ·  view source on GitHub ↗
(ctx context.Context, r *api.GetRequest, _ ...grpc.CallOption)

Source from the content-addressed store, hash-verified

404}
405
406func (l *local) Get(ctx context.Context, r *api.GetRequest, _ ...grpc.CallOption) (*api.GetResponse, error) {
407 task, err := l.getTask(ctx, r.ContainerID)
408 if err != nil {
409 return nil, err
410 }
411 p := runtime.Process(task)
412 if r.ExecID != "" {
413 if p, err = task.Process(ctx, r.ExecID); err != nil {
414 return nil, errgrpc.ToGRPC(err)
415 }
416 }
417 t, err := getProcessState(ctx, p)
418 if err != nil {
419 return nil, errgrpc.ToGRPC(err)
420 }
421 return &api.GetResponse{
422 Process: t,
423 }, nil
424}
425
426func (l *local) List(ctx context.Context, r *api.ListTasksRequest, _ ...grpc.CallOption) (*api.ListTasksResponse, error) {
427 resp := &api.ListTasksResponse{}

Callers

nothing calls this directly

Calls 4

getTaskMethod · 0.95
ProcessInterface · 0.92
getProcessStateFunction · 0.85
ProcessMethod · 0.65

Tested by

no test coverage detected