1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

fix Assign id as name when all else fails

This commit is contained in:
Victor Vieux 2013-11-07 12:23:29 -08:00
parent b5c984f9b4
commit 26f846bf77

View file

@ -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)