From 3130e66d332e12343c533ee183c5daab1cd3ed86 Mon Sep 17 00:00:00 2001 From: Liang Zhou Date: Wed, 9 Jun 2021 14:32:07 +0800 Subject: [PATCH] runtime: remove storeSandbox at the end of createSandboxFromConfig Remove storeSandbox() at the end of createSandboxFromConfig(), because this callchain createSandboxFromConfig -> createContainers has already calls storeSandbox(). This can improve the startup speed of the container, even just for a little. Fixes: #1980 Signed-off-by: Liang Zhou --- src/runtime/virtcontainers/api.go | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/runtime/virtcontainers/api.go b/src/runtime/virtcontainers/api.go index cd3ed93b0e..1be47d251a 100644 --- a/src/runtime/virtcontainers/api.go +++ b/src/runtime/virtcontainers/api.go @@ -120,11 +120,6 @@ func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, f return nil, err } - // The sandbox is completely created now, we can store it. - if err = s.storeSandbox(ctx); err != nil { - return nil, err - } - return s, nil }