MCPcopy Index your code
hub / github.com/containerd/containerd / LoadProcess

Method LoadProcess

client/task.go:681–707  ·  view source on GitHub ↗
(ctx context.Context, id string, ioAttach cio.Attach)

Source from the content-addressed store, hash-verified

679}
680
681func (t *task) LoadProcess(ctx context.Context, id string, ioAttach cio.Attach) (Process, error) {
682 if id == t.id && ioAttach == nil {
683 return t, nil
684 }
685 response, err := t.client.TaskService().Get(ctx, &tasks.GetRequest{
686 ContainerID: t.id,
687 ExecID: id,
688 })
689 if err != nil {
690 err = errgrpc.ToNative(err)
691 if errdefs.IsNotFound(err) {
692 return nil, fmt.Errorf("no running process found: %w", err)
693 }
694 return nil, err
695 }
696 var i cio.IO
697 if ioAttach != nil {
698 if i, err = attachExistingIO(response, ioAttach); err != nil {
699 return nil, err
700 }
701 }
702 return &process{
703 id: id,
704 task: t,
705 io: i,
706 }, nil
707}
708
709func (t *task) Metrics(ctx context.Context) (*types.Metric, error) {
710 response, err := t.client.TaskService().Metrics(ctx, &tasks.MetricsRequest{

Callers

nothing calls this directly

Calls 3

attachExistingIOFunction · 0.85
TaskServiceMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected