Skip to content

Commit 74d18cf

Browse files
author
Kathryn Baldauf
committed
Update runc kill wrapper to take a string for signal
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
1 parent d1e3ca2 commit 74d18cf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

runc.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ func (r *Runc) Delete(context context.Context, id string, opts *DeleteOpts) erro
327327
type KillOpts struct {
328328
All bool
329329
ExtraArgs []string
330+
RawSignal string
330331
}
331332

332333
func (o *KillOpts) args() (out []string) {
@@ -344,10 +345,14 @@ func (r *Runc) Kill(context context.Context, id string, sig int, opts *KillOpts)
344345
args := []string{
345346
"kill",
346347
}
348+
killSignal := strconv.Itoa(sig)
347349
if opts != nil {
348350
args = append(args, opts.args()...)
351+
if opts.RawSignal != "" {
352+
killSignal = opts.RawSignal
353+
}
349354
}
350-
return r.runOrError(r.command(context, append(args, id, strconv.Itoa(sig))...))
355+
return r.runOrError(r.command(context, append(args, id, killSignal)...))
351356
}
352357

353358
// Stats return the stats for a container like cpu, memory, and io

0 commit comments

Comments
 (0)