Merge pull request #24533 from yongtang/24392-docker-info-label-duplicate-keys

Remove duplicate keys in labels of `docker info`
Upstream-commit: 411e7b4416fbac0601db1fa28b5152c23fcaf7bb
Component: engine
This commit is contained in:
Sebastiaan van Stijn
2016-10-24 18:12:28 -07:00
committed by GitHub
5 changed files with 93 additions and 0 deletions

View File

@ -220,3 +220,15 @@ func (s *DockerDaemonSuite) TestRegistryMirrors(c *check.C) {
c.Assert(out, checker.Contains, fmt.Sprintf(" %s", registryMirror1))
c.Assert(out, checker.Contains, fmt.Sprintf(" %s", registryMirror2))
}
// Test case for #24392
func (s *DockerDaemonSuite) TestInfoLabels(c *check.C) {
testRequires(c, SameHostDaemon, DaemonIsLinux)
err := s.d.Start("--label", `test.empty=`, "--label", `test.empty=`, "--label", `test.label="1"`, "--label", `test.label="2"`)
c.Assert(err, checker.IsNil)
out, err := s.d.Cmd("info")
c.Assert(err, checker.IsNil)
c.Assert(out, checker.Contains, "WARNING: labels with duplicate keys and conflicting values have been deprecated")
}