From 2e6b241dc70c0f1ed6745af1f27b11bf77c84f3b Mon Sep 17 00:00:00 2001 From: Michael Crosby Date: Thu, 24 Oct 2013 10:25:07 -0700 Subject: [PATCH] Add default entity and edge to graph on runtime load --- runtime.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime.go b/runtime.go index 186ff4db8a..9ac9269317 100644 --- a/runtime.go +++ b/runtime.go @@ -257,6 +257,13 @@ func (runtime *Runtime) restore() error { return len(ic.Links) < len(jc.Links) }) for _, container := range containers { + + // Try to set the default name for a container if it exists prior to links + // Ignore the error because if it already exists you will get an invalid constraint + if _, err := runtime.containerGraph.Set(fmt.Sprintf("/%s", container.ID), container.ID); err != nil { + utils.Debugf("Setting default id - %s", err) + } + if err := runtime.Register(container); err != nil { utils.Debugf("Failed to register container %s: %s", container.ID, err) continue