소스 검색

archive: Always end directory filenames in tars with /

This matches what tar does, and without it the tarsum created
by the registry will not match the docker one.

Docker-DCO-1.1-Signed-off-by: Alexander Larsson <alexl@redhat.com> (github: alexlarsson)
Alexander Larsson 11 년 전
부모
커밋
f918fca3bf
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      archive/archive.go

+ 4 - 0
archive/archive.go

@@ -145,6 +145,10 @@ func addTarFile(path, name string, tw *tar.Writer) error {
 		return err
 	}
 
+	if fi.IsDir() && !strings.HasSuffix(name, "/") {
+		name = name + "/"
+	}
+
 	hdr.Name = name
 
 	stat, ok := fi.Sys().(*syscall.Stat_t)