Start starts the exec process
(ctx context.Context)
| 121 | |
| 122 | // Start starts the exec process |
| 123 | func (p *process) Start(ctx context.Context) error { |
| 124 | ctx, span := tracing.StartSpan(ctx, "process.Start", |
| 125 | tracing.WithAttribute("process.id", p.ID()), |
| 126 | tracing.WithAttribute("process.task.id", p.task.ID()), |
| 127 | ) |
| 128 | defer span.End() |
| 129 | r, err := p.task.client.TaskService().Start(ctx, &tasks.StartRequest{ |
| 130 | ContainerID: p.task.id, |
| 131 | ExecID: p.id, |
| 132 | }) |
| 133 | if err != nil { |
| 134 | if p.io != nil { |
| 135 | p.io.Cancel() |
| 136 | p.io.Wait() |
| 137 | p.io.Close() |
| 138 | } |
| 139 | return errgrpc.ToNative(err) |
| 140 | } |
| 141 | span.SetAttributes(tracing.Attribute("process.pid", int(r.Pid))) |
| 142 | p.pid = r.Pid |
| 143 | return nil |
| 144 | } |
| 145 | |
| 146 | func (p *process) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts) error { |
| 147 | ctx, span := tracing.StartSpan(ctx, "process.Kill", |
nothing calls this directly
no test coverage detected