Fix docker search problem

Search terms shouldn't be restricted to only full valid repository
names. It should be perfectly valid to search using a part of a name,
even if it ends with a period, dash or underscore.

Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
Hu Keping
2015-10-04 23:23:43 +08:00
committed by HuKeping
parent ebe7ef9fc2
commit f04e8fdb9b
4 changed files with 38 additions and 8 deletions
@@ -89,3 +89,11 @@ func (s *DockerSuite) TestSearchCmdOptions(c *check.C) {
c.Fatalf("failed to search with stars&automated&no-trunc options on the central registry: %s", out)
}
}
// search for repos which start with "ubuntu-" on the central registry
func (s *DockerSuite) TestSearchOnCentralRegistryWithDash(c *check.C) {
testRequires(c, Network, DaemonIsLinux)
out, exitCode := dockerCmd(c, "search", "ubuntu-")
c.Assert(exitCode, check.Equals, 0, check.Commentf("failed to search on the central registry: %s", out))
}