| 724 | } |
| 725 | |
| 726 | func (s *shimTask) Exec(ctx context.Context, id string, opts runtime.ExecOpts) (runtime.ExecProcess, error) { |
| 727 | if err := identifiers.Validate(id); err != nil { |
| 728 | return nil, fmt.Errorf("invalid exec id %s: %w", id, err) |
| 729 | } |
| 730 | request := &task.ExecProcessRequest{ |
| 731 | ID: s.ID(), |
| 732 | ExecID: id, |
| 733 | Stdin: opts.IO.Stdin, |
| 734 | Stdout: opts.IO.Stdout, |
| 735 | Stderr: opts.IO.Stderr, |
| 736 | Terminal: opts.IO.Terminal, |
| 737 | Spec: opts.Spec, |
| 738 | } |
| 739 | if _, err := s.task.Exec(ctx, request); err != nil { |
| 740 | return nil, errgrpc.ToNative(err) |
| 741 | } |
| 742 | return &process{ |
| 743 | id: id, |
| 744 | shim: s, |
| 745 | }, nil |
| 746 | } |
| 747 | |
| 748 | func (s *shimTask) Pids(ctx context.Context) ([]runtime.ProcessInfo, error) { |
| 749 | resp, err := s.task.Pids(ctx, &task.PidsRequest{ |