Add log of generated id for debugging.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu 2017-10-26 23:37:17 +00:00
parent 6c6b337e87
commit 5e74cba0f0
2 changed files with 2 additions and 0 deletions

View File

@ -89,6 +89,7 @@ func (c *criContainerdService) CreateContainer(ctx context.Context, r *runtime.C
// the same container. // the same container.
id := util.GenerateID() id := util.GenerateID()
name := makeContainerName(config.GetMetadata(), sandboxConfig.GetMetadata()) name := makeContainerName(config.GetMetadata(), sandboxConfig.GetMetadata())
glog.V(4).Infof("Generated id %q for container %q", id, name)
if err = c.containerNameIndex.Reserve(name, id); err != nil { if err = c.containerNameIndex.Reserve(name, id); err != nil {
return nil, fmt.Errorf("failed to reserve container name %q: %v", name, err) return nil, fmt.Errorf("failed to reserve container name %q: %v", name, err)
} }

View File

@ -51,6 +51,7 @@ func (c *criContainerdService) RunPodSandbox(ctx context.Context, r *runtime.Run
// Generate unique id and name for the sandbox and reserve the name. // Generate unique id and name for the sandbox and reserve the name.
id := util.GenerateID() id := util.GenerateID()
name := makeSandboxName(config.GetMetadata()) name := makeSandboxName(config.GetMetadata())
glog.V(4).Infof("Generated id %q for sandbox %q", id, name)
// Reserve the sandbox name to avoid concurrent `RunPodSandbox` request starting the // Reserve the sandbox name to avoid concurrent `RunPodSandbox` request starting the
// same sandbox. // same sandbox.
if err := c.sandboxNameIndex.Reserve(name, id); err != nil { if err := c.sandboxNameIndex.Reserve(name, id); err != nil {