瀏覽代碼

Fixups for 39695 - edit comments, redundant lines

1. Modify comments added in 5858a99267822b93e2d304d876bab84d05b227c6
Windows Volume GUID path format is: \\?\Volume{<GUID Value>}\<path>
Rewrote the example given in comments to conform to the format..

2. Remove two redundant asserts[assert.NilError]. They are redundant
because the last statement will not change the value of err.

Signed-off-by: Vikram bir Singh <vikrambir.singh@docker.com>
Vikram bir Singh 5 年之前
父節點
當前提交
b146b2382c
共有 2 個文件被更改,包括 4 次插入3 次删除
  1. 4 1
      builder/dockerfile/copy.go
  2. 0 2
      integration/build/build_test.go

+ 4 - 1
builder/dockerfile/copy.go

@@ -559,7 +559,10 @@ func copyFile(archiver Archiver, source, dest *copyEndpoint, identity *idtools.I
 		// Normal containers
 		// Normal containers
 		if identity == nil {
 		if identity == nil {
 			// Use system.MkdirAll here, which is a custom version of os.MkdirAll
 			// Use system.MkdirAll here, which is a custom version of os.MkdirAll
-			// modified for use on Windows to handle volume GUID paths (\\?\{dae8d3ac-b9a1-11e9-88eb-e8554b2ba1db}\path\)
+			// modified for use on Windows to handle volume GUID paths. These paths
+			// are of the form \\?\Volume{<GUID>}\<path>. An example would be:
+			// \\?\Volume{dae8d3ac-b9a1-11e9-88eb-e8554b2ba1db}\bin\busybox.exe
+
 			if err := system.MkdirAll(filepath.Dir(dest.path), 0755, ""); err != nil {
 			if err := system.MkdirAll(filepath.Dir(dest.path), 0755, ""); err != nil {
 				return err
 				return err
 			}
 			}

+ 0 - 2
integration/build/build_test.go

@@ -170,7 +170,6 @@ func TestBuildMultiStageCopy(t *testing.T) {
 			assert.NilError(t, err)
 			assert.NilError(t, err)
 
 
 			out := bytes.NewBuffer(nil)
 			out := bytes.NewBuffer(nil)
-			assert.NilError(t, err)
 			_, err = io.Copy(out, resp.Body)
 			_, err = io.Copy(out, resp.Body)
 			_ = resp.Body.Close()
 			_ = resp.Body.Close()
 			if err != nil {
 			if err != nil {
@@ -604,7 +603,6 @@ func TestBuildPreserveOwnership(t *testing.T) {
 			assert.NilError(t, err)
 			assert.NilError(t, err)
 
 
 			out := bytes.NewBuffer(nil)
 			out := bytes.NewBuffer(nil)
-			assert.NilError(t, err)
 			_, err = io.Copy(out, resp.Body)
 			_, err = io.Copy(out, resp.Body)
 			_ = resp.Body.Close()
 			_ = resp.Body.Close()
 			if err != nil {
 			if err != nil {