Browse Source

Fix duplicate layers in manifest

Currently the layer array is initialized with the first layer then the first layer is appened to the layer list. Adding the first layer twice causes the layer to appear twice in the manifest, making a duplicate push and pull attempt occur.

Signed-off-by: Derek McGowan <derek@mcgstyle.net> (github: dmcgowan)
Derek McGowan 10 years ago
parent
commit
35081ea4b6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      graph/push.go

+ 1 - 1
graph/push.go

@@ -349,7 +349,7 @@ func (s *TagStore) pushV2Repository(r *registry.Session, localRepo Repository, o
 		}
 		}
 
 
 		layersSeen := make(map[string]bool)
 		layersSeen := make(map[string]bool)
-		layers := []*image.Image{layer}
+		layers := []*image.Image{}
 		for ; layer != nil; layer, err = s.graph.GetParent(layer) {
 		for ; layer != nil; layer, err = s.graph.GetParent(layer) {
 			if err != nil {
 			if err != nil {
 				return err
 				return err