From d59572be9d95c949d0af1beb52498127cc62d569 Mon Sep 17 00:00:00 2001 From: Nate Jones Date: Mon, 6 May 2013 21:31:59 -0700 Subject: [PATCH] fix ByParent Upstream-commit: 23c5c130148985e3e527fa799beb45326ac791a9 Component: engine --- components/engine/graph.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/engine/graph.go b/components/engine/graph.go index 21d9d9407c..9a8fd1b3cb 100644 --- a/components/engine/graph.go +++ b/components/engine/graph.go @@ -253,14 +253,14 @@ func (graph *Graph) WalkAll(handler func(*Image)) error { func (graph *Graph) ByParent() (map[string][]*Image, error) { byParent := make(map[string][]*Image) err := graph.WalkAll(func(image *Image) { - image, err := graph.Get(image.Parent) + parent, err := graph.Get(image.Parent) if err != nil { return } - if children, exists := byParent[image.Parent]; exists { - byParent[image.Parent] = []*Image{image} + if children, exists := byParent[parent.Id]; exists { + byParent[parent.Id] = []*Image{image} } else { - byParent[image.Parent] = append(children, image) + byParent[parent.Id] = append(children, image) } }) return byParent, err