mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-05 05:01:28 +00:00
Revert #14884
This reverts commit 810d3b2642.
Signed-off-by: Arnaud Porterie <arnaud.porterie@docker.com>
This commit is contained in:
@@ -60,32 +60,7 @@ func (s *DockerRegistrySuite) TestPushMultipleTags(c *check.C) {
|
||||
|
||||
dockerCmd(c, "tag", "busybox", repoTag2)
|
||||
|
||||
out, _ := dockerCmd(c, "push", repoName)
|
||||
|
||||
// There should be no duplicate hashes in the output
|
||||
imageSuccessfullyPushed := ": Image successfully pushed"
|
||||
imageAlreadyExists := ": Image already exists"
|
||||
imagePushHashes := make(map[string]struct{})
|
||||
outputLines := strings.Split(out, "\n")
|
||||
for _, outputLine := range outputLines {
|
||||
if strings.Contains(outputLine, imageSuccessfullyPushed) {
|
||||
hash := strings.TrimSuffix(outputLine, imageSuccessfullyPushed)
|
||||
if _, present := imagePushHashes[hash]; present {
|
||||
c.Fatalf("Duplicate image push: %s", outputLine)
|
||||
}
|
||||
imagePushHashes[hash] = struct{}{}
|
||||
} else if strings.Contains(outputLine, imageAlreadyExists) {
|
||||
hash := strings.TrimSuffix(outputLine, imageAlreadyExists)
|
||||
if _, present := imagePushHashes[hash]; present {
|
||||
c.Fatalf("Duplicate image push: %s", outputLine)
|
||||
}
|
||||
imagePushHashes[hash] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
if len(imagePushHashes) == 0 {
|
||||
c.Fatal(`Expected at least one line containing "Image successfully pushed"`)
|
||||
}
|
||||
dockerCmd(c, "push", repoName)
|
||||
}
|
||||
|
||||
func (s *DockerRegistrySuite) TestPushInterrupt(c *check.C) {
|
||||
|
||||
Reference in New Issue
Block a user