(ctx context.Context, id string, ioAttach cio.Attach)
| 679 | } |
| 680 | |
| 681 | func (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 | |
| 709 | func (t *task) Metrics(ctx context.Context) (*types.Metric, error) { |
| 710 | response, err := t.client.TaskService().Metrics(ctx, &tasks.MetricsRequest{ |
nothing calls this directly
no test coverage detected