Merge pull request #11437 from duglin/FixLabels
Some fixes for new LABEL stuff
This commit is contained in:
commit
ad56b5c603
4 changed files with 4 additions and 2 deletions
|
@ -22,6 +22,7 @@ const (
|
|||
// Commands is list of all Dockerfile commands
|
||||
var Commands = map[string]struct{}{
|
||||
Env: {},
|
||||
Label: {},
|
||||
Maintainer: {},
|
||||
Add: {},
|
||||
Copy: {},
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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: {},
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue