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

Method Exec

core/runtime/v2/shim.go:726–746  ·  view source on GitHub ↗
(ctx context.Context, id string, opts runtime.ExecOpts)

Source from the content-addressed store, hash-verified

724}
725
726func (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
748func (s *shimTask) Pids(ctx context.Context) ([]runtime.ProcessInfo, error) {
749 resp, err := s.task.Pids(ctx, &task.PidsRequest{

Callers

nothing calls this directly

Calls 3

ValidateFunction · 0.92
IDMethod · 0.65
ExecMethod · 0.65

Tested by

no test coverage detected