Skip to content

Commit

Permalink
Merge pull request moby#11437 from duglin/FixLabels
Browse files Browse the repository at this point in the history
Some fixes for new LABEL stuff
  • Loading branch information
Arnaud Porterie committed Mar 17, 2015
2 parents b6ac111 + 6784a77 commit ad56b5c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions builder/command/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ const (
// Commands is list of all Dockerfile commands
var Commands = map[string]struct{}{
Env: {},
Label: {},
Maintainer: {},
Add: {},
Copy: {},
Expand Down
2 changes: 1 addition & 1 deletion builder/dispatchers.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func maintainer(b *Builder, args []string, attributes map[string]bool, original
//
func label(b *Builder, args []string, attributes map[string]bool, original string) error {
if len(args) == 0 {
return fmt.Errorf("LABEL is missing arguments")
return fmt.Errorf("LABEL requires at least one argument")
}
if len(args)%2 != 0 {
// should never get here, but just in case
Expand Down
1 change: 1 addition & 0 deletions builder/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var (
// Environment variable interpolation will happen on these statements only.
var replaceEnvAllowed = map[string]struct{}{
command.Env: {},
command.Label: {},
command.Add: {},
command.Copy: {},
command.Workdir: {},
Expand Down
2 changes: 1 addition & 1 deletion builder/parser/line_parsers.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func parseNameVal(rest string, key string) (*Node, map[string]bool, error) {
}

if len(words) == 0 {
return nil, nil, fmt.Errorf(key + " requires at least one argument")
return nil, nil, nil
}

// Old format (KEY name value)
Expand Down

0 comments on commit ad56b5c

Please sign in to comment.