mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-24 21:51:37 +00:00
runtime: Fix trace span ordering
Return ctx in trace() functions to correct span ordering. Fixes #1550 Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
This commit is contained in:
@@ -53,7 +53,7 @@ func SetLogger(ctx context.Context, logger *logrus.Entry) {
|
||||
// CreateSandbox is the virtcontainers sandbox creation entry point.
|
||||
// CreateSandbox creates a sandbox and its containers. It does not start them.
|
||||
func CreateSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Factory) (VCSandbox, error) {
|
||||
span, _ := trace(ctx, "CreateSandbox")
|
||||
span, ctx := trace(ctx, "CreateSandbox")
|
||||
defer span.End()
|
||||
|
||||
s, err := createSandboxFromConfig(ctx, sandboxConfig, factory)
|
||||
@@ -62,7 +62,7 @@ func CreateSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Fac
|
||||
}
|
||||
|
||||
func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, factory Factory) (_ *Sandbox, err error) {
|
||||
span, _ := trace(ctx, "createSandboxFromConfig")
|
||||
span, ctx := trace(ctx, "createSandboxFromConfig")
|
||||
defer span.End()
|
||||
|
||||
// Create the sandbox.
|
||||
@@ -136,7 +136,7 @@ func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, f
|
||||
// in the sandbox left, do stop the sandbox and delete it. Those serial operations will be done exclusively by
|
||||
// locking the sandbox.
|
||||
func CleanupContainer(ctx context.Context, sandboxID, containerID string, force bool) error {
|
||||
span, _ := trace(ctx, "CleanupContainer")
|
||||
span, ctx := trace(ctx, "CleanupContainer")
|
||||
defer span.End()
|
||||
|
||||
if sandboxID == "" {
|
||||
|
||||
Reference in New Issue
Block a user