зеркало из https://github.com/microsoft/docker.git
Merge pull request #10914 from kargakis/map-commands
Map Commands instead of using them as a slice
This commit is contained in:
Коммит
c5aca86654
|
@ -19,19 +19,19 @@ const (
|
|||
)
|
||||
|
||||
// Commands is list of all Dockerfile commands
|
||||
var Commands = []string{
|
||||
Env,
|
||||
Maintainer,
|
||||
Add,
|
||||
Copy,
|
||||
From,
|
||||
Onbuild,
|
||||
Workdir,
|
||||
Run,
|
||||
Cmd,
|
||||
Entrypoint,
|
||||
Expose,
|
||||
Volume,
|
||||
User,
|
||||
Insert,
|
||||
var Commands = map[string]struct{}{
|
||||
Env: {},
|
||||
Maintainer: {},
|
||||
Add: {},
|
||||
Copy: {},
|
||||
From: {},
|
||||
Onbuild: {},
|
||||
Workdir: {},
|
||||
Run: {},
|
||||
Cmd: {},
|
||||
Entrypoint: {},
|
||||
Expose: {},
|
||||
Volume: {},
|
||||
User: {},
|
||||
Insert: {},
|
||||
}
|
||||
|
|
|
@ -4836,7 +4836,7 @@ func TestBuildMissingArgs(t *testing.T) {
|
|||
|
||||
defer deleteAllContainers()
|
||||
|
||||
for _, cmd := range command.Commands {
|
||||
for cmd := range command.Commands {
|
||||
cmd = strings.ToUpper(cmd)
|
||||
if _, ok := skipCmds[cmd]; ok {
|
||||
continue
|
||||
|
|
Загрузка…
Ссылка в новой задаче