Merge pull request #17880 from duglin/TweakMap

convert map value from struct to bool
This commit is contained in:
Vincent Demeester 2015-11-11 13:49:50 +01:00
commit 2a7b5f6657
1 changed files with 13 additions and 13 deletions

View File

@ -29,17 +29,17 @@ import (
) )
// Environment variable interpolation will happen on these statements only. // Environment variable interpolation will happen on these statements only.
var replaceEnvAllowed = map[string]struct{}{ var replaceEnvAllowed = map[string]bool{
command.Env: {}, command.Env: true,
command.Label: {}, command.Label: true,
command.Add: {}, command.Add: true,
command.Copy: {}, command.Copy: true,
command.Workdir: {}, command.Workdir: true,
command.Expose: {}, command.Expose: true,
command.Volume: {}, command.Volume: true,
command.User: {}, command.User: true,
command.StopSignal: {}, command.StopSignal: true,
command.Arg: {}, command.Arg: true,
} }
// Certain commands are allowed to have their args split into more // Certain commands are allowed to have their args split into more
@ -163,11 +163,11 @@ func (b *Builder) dispatch(stepN int, ast *parser.Node) error {
ast = ast.Next ast = ast.Next
var str string var str string
str = ast.Value str = ast.Value
if _, ok := replaceEnvAllowed[cmd]; ok { if replaceEnvAllowed[cmd] {
var err error var err error
var words []string var words []string
if _, ok := allowWordExpansion[cmd]; ok { if allowWordExpansion[cmd] {
words, err = ProcessWords(str, envs) words, err = ProcessWords(str, envs)
if err != nil { if err != nil {
return err return err