зеркало из https://github.com/microsoft/docker.git
Remove hardcoded error
Signed-off-by: Antonio Murdaca <me@runcom.ninja>
This commit is contained in:
Родитель
65e21f5703
Коммит
8b02d85e17
|
@ -20,7 +20,6 @@
|
|||
package builder
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
|
@ -42,10 +41,6 @@ import (
|
|||
"github.com/docker/docker/utils"
|
||||
)
|
||||
|
||||
var (
|
||||
ErrDockerfileEmpty = errors.New("Dockerfile cannot be empty")
|
||||
)
|
||||
|
||||
// Environment variable interpolation will happen on these statements only.
|
||||
var replaceEnvAllowed = map[string]struct{}{
|
||||
command.Env: {},
|
||||
|
@ -225,7 +220,7 @@ func (b *Builder) readDockerfile() error {
|
|||
return fmt.Errorf("Cannot locate specified Dockerfile: %s", origFile)
|
||||
}
|
||||
if fi.Size() == 0 {
|
||||
return ErrDockerfileEmpty
|
||||
return fmt.Errorf("The Dockerfile (%s) cannot be empty", origFile)
|
||||
}
|
||||
|
||||
f, err := os.Open(filename)
|
||||
|
|
|
@ -3504,7 +3504,7 @@ func TestBuildFailsDockerfileEmpty(t *testing.T) {
|
|||
defer deleteImages(name)
|
||||
_, err := buildImage(name, ``, true)
|
||||
if err != nil {
|
||||
if !strings.Contains(err.Error(), "Dockerfile cannot be empty") {
|
||||
if !strings.Contains(err.Error(), "The Dockerfile (Dockerfile) cannot be empty") {
|
||||
t.Fatalf("Wrong error %v, must be about empty Dockerfile", err)
|
||||
}
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче