From 6b4b6956e3a0a7943782a5ea4ccbaa39a54ea749 Mon Sep 17 00:00:00 2001 From: Danny Canter Date: Sat, 4 Mar 2023 01:11:21 -0800 Subject: [PATCH] Sandbox: Fix/enhance error messages for Create CreateSandbox states "failed to start sandbox". This is quite confusing when you're perusing logs and trying to pinpoint how far a shim got in its execution. Signed-off-by: Danny Canter --- plugins/sandbox/controller.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/sandbox/controller.go b/plugins/sandbox/controller.go index f1bb69ca6..712c617cb 100644 --- a/plugins/sandbox/controller.go +++ b/plugins/sandbox/controller.go @@ -102,9 +102,8 @@ func (c *controllerLocal) Create(ctx context.Context, sandboxID string, opts ... Runtime: info.Runtime.Name, TaskOptions: nil, }) - if err != nil { - return fmt.Errorf("failed to start new sandbox: %w", err) + return fmt.Errorf("failed to start new shim for sandbox %s: %w", sandboxID, err) } svc, err := sandbox.NewClient(shim.Client()) @@ -127,7 +126,7 @@ func (c *controllerLocal) Create(ctx context.Context, sandboxID string, opts ... Options: options, }); err != nil { // TODO: Delete sandbox shim here. - return fmt.Errorf("failed to start sandbox %s: %w", sandboxID, errdefs.FromGRPC(err)) + return fmt.Errorf("failed to create sandbox %s: %w", sandboxID, errdefs.FromGRPC(err)) } return nil