Forráskód Böngészése

Merge pull request #244 from thaJeztah/18.09_backport_fix_copying

[18.09 backport] image: do actual RootFS.DiffIDs copying in Clone()
Andrew Hsu 6 éve
szülő
commit
423f39ab05
1 módosított fájl, 2 hozzáadás és 1 törlés
  1. 2 1
      image/rootfs.go

+ 2 - 1
image/rootfs.go

@@ -38,7 +38,8 @@ func (r *RootFS) Append(id layer.DiffID) {
 func (r *RootFS) Clone() *RootFS {
 	newRoot := NewRootFS()
 	newRoot.Type = r.Type
-	newRoot.DiffIDs = append(r.DiffIDs)
+	newRoot.DiffIDs = make([]layer.DiffID, len(r.DiffIDs))
+	copy(newRoot.DiffIDs, r.DiffIDs)
 	return newRoot
 }