From cabddcc73571e139d4cdec3dc0bfe50e048e30fe Mon Sep 17 00:00:00 2001 From: Chelsea Mafrica Date: Thu, 10 Jun 2021 23:47:57 -0700 Subject: [PATCH] tracing: Make runHooks() span creation return context The call to Trace() in runHooks() does not return a context; fix this so that the subsequent calls to runHook() produces a properly ordered trace span. Fixes #2001 Signed-off-by: Chelsea Mafrica --- src/runtime/pkg/katautils/hook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/pkg/katautils/hook.go b/src/runtime/pkg/katautils/hook.go index fda1a75478..22f2b25a3e 100644 --- a/src/runtime/pkg/katautils/hook.go +++ b/src/runtime/pkg/katautils/hook.go @@ -88,7 +88,7 @@ func runHook(ctx context.Context, hook specs.Hook, cid, bundlePath string) error } func runHooks(ctx context.Context, hooks []specs.Hook, cid, bundlePath, hookType string) error { - span, _ := Trace(ctx, "runHooks", []label.KeyValue{label.Key("source").String("runtime"), label.Key("package").String("katautils"), label.Key("subsystem").String("hook"), label.Key("type").String(hookType)}...) + span, ctx := Trace(ctx, "runHooks", []label.KeyValue{label.Key("source").String("runtime"), label.Key("package").String("katautils"), label.Key("subsystem").String("hook"), label.Key("type").String(hookType)}...) defer span.End() for _, hook := range hooks {