commit: do not change container labels on commit

Fix #29547

Signed-off-by: Alexander Morozov <lk4d4@docker.com>
Upstream-commit: ca6c6f0765aeccdb2730d03c05bd965906df8cd4
Component: engine
This commit is contained in:
Alexander Morozov
2016-12-19 09:56:20 -08:00
parent d696b498fb
commit fde61754e9
2 changed files with 16 additions and 4 deletions
@@ -142,3 +142,16 @@ func (s *DockerSuite) TestCommitChange(c *check.C) {
}
}
}
func (s *DockerSuite) TestCommitChangeLabels(c *check.C) {
dockerCmd(c, "run", "--name", "test", "--label", "some=label", "busybox", "true")
imageID, _ := dockerCmd(c, "commit",
"--change", "LABEL some=label2",
"test", "test-commit")
imageID = strings.TrimSpace(imageID)
c.Assert(inspectField(c, imageID, "Config.Labels"), checker.Equals, "map[some:label2]")
// check that container labels didn't change
c.Assert(inspectField(c, "test", "Config.Labels"), checker.Equals, "map[some:label]")
}