Преглед на файлове

Merge pull request #2692 from SvenDowideit/add-specific-feedback-for-bad-ADD

Add specific feedback for ADD outside context
Victor Vieux преди 11 години
родител
ревизия
926f7b579e
променени са 2 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 1 1
      buildfile.go
  2. 1 1
      integration/buildfile_test.go

+ 1 - 1
buildfile.go

@@ -288,7 +288,7 @@ func (b *buildFile) addContext(container *Container, orig, dest string) error {
 		destPath = destPath + "/"
 	}
 	if !strings.HasPrefix(origPath, b.context) {
-		return fmt.Errorf("Forbidden path: %s", origPath)
+		return fmt.Errorf("Forbidden path outside the build context: %s (%s)", orig, origPath)
 	}
 	fi, err := os.Stat(origPath)
 	if err != nil {

+ 1 - 1
integration/buildfile_test.go

@@ -483,7 +483,7 @@ func TestForbiddenContextPath(t *testing.T) {
 		t.Fail()
 	}
 
-	if err.Error() != "Forbidden path: /" {
+	if err.Error() != "Forbidden path outside the build context: ../../ (/)" {
 		t.Logf("Error message is not expected: %s", err.Error())
 		t.Fail()
 	}