From 26f846bf779c97a69e85db356dff8c1fff76161c Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Thu, 7 Nov 2013 12:23:29 -0800 Subject: [PATCH] fix Assign id as name when all else fails --- runtime.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime.go b/runtime.go index 0ef6786b21..671694fce5 100644 --- a/runtime.go +++ b/runtime.go @@ -286,13 +286,12 @@ func (runtime *Runtime) restore() error { // Any containers that are left over do not exist in the graph for _, container := range containers { // Try to set the default name for a container if it exists prior to links - name, err := generateRandomName(runtime) + container.Name, err = generateRandomName(runtime) if err != nil { container.Name = container.ShortID() } - container.Name = name - if _, err := runtime.containerGraph.Set(name, container.ID); err != nil { + if _, err := runtime.containerGraph.Set(container.Name, container.ID); err != nil { utils.Debugf("Setting default id - %s", err) } register(container)