1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

just adding label to whitelist for commit command (Fixes #13738)

Signed-off-by: Tom Howe <turtlebender@gmail.com>
This commit is contained in:
Tom Howe 2015-06-04 08:47:55 -05:00
parent b1f984a29f
commit 6e2662b3ba
2 changed files with 16 additions and 0 deletions

View file

@ -34,6 +34,8 @@ var validCommitCommands = map[string]bool{
"volume": true,
"expose": true,
"onbuild": true,
"label": true,
"maintainer": true,
}
type Config struct {

View file

@ -223,6 +223,13 @@ func (s *DockerSuite) TestCommitChange(c *check.C) {
"--change", "ENV DEBUG true",
"--change", "ENV test 1",
"--change", "ENV PATH /foo",
"--change", "LABEL foo bar",
"--change", "CMD [\"/bin/sh\"]",
"--change", "WORKDIR /opt",
"--change", "ENTRYPOINT [\"/bin/sh\"]",
"--change", "USER testuser",
"--change", "VOLUME /var/lib/docker",
"--change", "ONBUILD /usr/local/bin/python-build --dir /app/src",
"test", "test-commit")
imageId, _, err := runCommandWithOutput(cmd)
if err != nil {
@ -233,6 +240,13 @@ func (s *DockerSuite) TestCommitChange(c *check.C) {
expected := map[string]string{
"Config.ExposedPorts": "map[8080/tcp:{}]",
"Config.Env": "[DEBUG=true test=1 PATH=/foo]",
"Config.Labels": "map[foo:bar]",
"Config.Cmd": "{[/bin/sh]}",
"Config.WorkingDir": "/opt",
"Config.Entrypoint": "{[/bin/sh]}",
"Config.User": "testuser",
"Config.Volumes": "map[/var/lib/docker:{}]",
"Config.OnBuild": "[/usr/local/bin/python-build --dir /app/src]",
}
for conf, value := range expected {