Merge pull request #32370 from AkihiroSuda/improve-build-error

builder/dockerfile: improve error message about build stage name
This commit is contained in:
Vincent Demeester 2017-04-12 16:33:23 +02:00 committed by GitHub
commit 3c07259882
2 changed files with 1 additions and 2 deletions

View File

@ -211,7 +211,7 @@ func from(b *Builder, args []string, attributes map[string]bool, original string
return errors.Errorf("invalid name for build stage: %q, name can't start with a number or contain symbols", ctxName)
}
} else if len(args) != 1 {
return errExactlyOneArgument("FROM")
return errors.New("FROM requires either one or three arguments")
}
if err := b.flags.Parse(); err != nil {

View File

@ -22,7 +22,6 @@ type commandWithFunction struct {
func TestCommandsExactlyOneArgument(t *testing.T) {
commands := []commandWithFunction{
{"MAINTAINER", func(args []string) error { return maintainer(nil, args, nil, "") }},
{"FROM", func(args []string) error { return from(nil, args, nil, "") }},
{"WORKDIR", func(args []string) error { return workdir(nil, args, nil, "") }},
{"USER", func(args []string) error { return user(nil, args, nil, "") }},
{"STOPSIGNAL", func(args []string) error { return stopSignal(nil, args, nil, "") }}}