From 47da1ff415eaf8bb78c60f578f16f1ef4287f888 Mon Sep 17 00:00:00 2001 From: Austin Vazquez Date: Sat, 28 Oct 2023 18:24:43 -0700 Subject: [PATCH] Fix interval parsing for runc events. Before runc events interval configurations less than 1 second would be truncated to 0. This change enables millisecond events channel ticks. Signed-off-by: Austin Vazquez --- runc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runc.go b/runc.go index 61646df..4582075 100644 --- a/runc.go +++ b/runc.go @@ -423,7 +423,7 @@ func (r *Runc) Stats(context context.Context, id string) (*Stats, error) { // Events returns an event stream from runc for a container with stats and OOM notifications func (r *Runc) Events(context context.Context, id string, interval time.Duration) (chan *Event, error) { - cmd := r.command(context, "events", fmt.Sprintf("--interval=%ds", int(interval.Seconds())), id) + cmd := r.command(context, "events", fmt.Sprintf("--interval=%s", interval.String()), id) rd, err := cmd.StdoutPipe() if err != nil { return nil, err