Just for @calavera !! :-)
Per: https://github.com/docker/docker/pull/17789#discussion_r44333133
Signed-off-by: Doug Davis <dug@us.ibm.com>
| ... | ... |
@@ -29,17 +29,17 @@ import ( |
| 29 | 29 |
) |
| 30 | 30 |
|
| 31 | 31 |
// Environment variable interpolation will happen on these statements only. |
| 32 |
-var replaceEnvAllowed = map[string]struct{}{
|
|
| 33 |
- command.Env: {},
|
|
| 34 |
- command.Label: {},
|
|
| 35 |
- command.Add: {},
|
|
| 36 |
- command.Copy: {},
|
|
| 37 |
- command.Workdir: {},
|
|
| 38 |
- command.Expose: {},
|
|
| 39 |
- command.Volume: {},
|
|
| 40 |
- command.User: {},
|
|
| 41 |
- command.StopSignal: {},
|
|
| 42 |
- command.Arg: {},
|
|
| 32 |
+var replaceEnvAllowed = map[string]bool{
|
|
| 33 |
+ command.Env: true, |
|
| 34 |
+ command.Label: true, |
|
| 35 |
+ command.Add: true, |
|
| 36 |
+ command.Copy: true, |
|
| 37 |
+ command.Workdir: true, |
|
| 38 |
+ command.Expose: true, |
|
| 39 |
+ command.Volume: true, |
|
| 40 |
+ command.User: true, |
|
| 41 |
+ command.StopSignal: true, |
|
| 42 |
+ command.Arg: true, |
|
| 43 | 43 |
} |
| 44 | 44 |
|
| 45 | 45 |
// 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 {
|
| 163 | 163 |
ast = ast.Next |
| 164 | 164 |
var str string |
| 165 | 165 |
str = ast.Value |
| 166 |
- if _, ok := replaceEnvAllowed[cmd]; ok {
|
|
| 166 |
+ if replaceEnvAllowed[cmd] {
|
|
| 167 | 167 |
var err error |
| 168 | 168 |
var words []string |
| 169 | 169 |
|
| 170 |
- if _, ok := allowWordExpansion[cmd]; ok {
|
|
| 170 |
+ if allowWordExpansion[cmd] {
|
|
| 171 | 171 |
words, err = ProcessWords(str, envs) |
| 172 | 172 |
if err != nil {
|
| 173 | 173 |
return err |