MCPcopy
hub / github.com/containerd/containerd / Kill

Method Kill

client/process.go:146–166  ·  view source on GitHub ↗
(ctx context.Context, s syscall.Signal, opts ...KillOpts)

Source from the content-addressed store, hash-verified

144}
145
146func (p *process) Kill(ctx context.Context, s syscall.Signal, opts ...KillOpts) error {
147 ctx, span := tracing.StartSpan(ctx, "process.Kill",
148 tracing.WithAttribute("process.id", p.ID()),
149 tracing.WithAttribute("process.pid", int(p.Pid())),
150 tracing.WithAttribute("process.task.id", p.task.ID()),
151 )
152 defer span.End()
153 var i KillInfo
154 for _, o := range opts {
155 if err := o(ctx, &i); err != nil {
156 return err
157 }
158 }
159 _, err := p.task.client.TaskService().Kill(ctx, &tasks.KillRequest{
160 Signal: uint32(s),
161 ContainerID: p.task.id,
162 ExecID: p.id,
163 All: i.All,
164 })
165 return errgrpc.ToNative(err)
166}
167
168func (p *process) Wait(ctx context.Context) (<-chan ExitStatus, error) {
169 c := make(chan ExitStatus, 1)

Callers

nothing calls this directly

Calls 8

IDMethod · 0.95
PidMethod · 0.95
StartSpanFunction · 0.92
WithAttributeFunction · 0.92
EndMethod · 0.80
TaskServiceMethod · 0.80
IDMethod · 0.65
KillMethod · 0.65

Tested by

no test coverage detected