зеркало из https://github.com/microsoft/docker.git
Add default entity and edge to graph on runtime load
This commit is contained in:
Родитель
94e5081bac
Коммит
2e6b241dc7
|
@ -257,6 +257,13 @@ func (runtime *Runtime) restore() error {
|
||||||
return len(ic.Links) < len(jc.Links)
|
return len(ic.Links) < len(jc.Links)
|
||||||
})
|
})
|
||||||
for _, container := range containers {
|
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 {
|
if err := runtime.Register(container); err != nil {
|
||||||
utils.Debugf("Failed to register container %s: %s", container.ID, err)
|
utils.Debugf("Failed to register container %s: %s", container.ID, err)
|
||||||
continue
|
continue
|
||||||
|
|
Загрузка…
Ссылка в новой задаче