Browse code

integration-cli/TestCrossRepositoryLayerPush: Change repo name

Change the repo name used as for an intermediate image so it doesn't
try to mount from the image pushed by `TestBuildMultiStageImplicitPull`.

Before this patch, this test failed because the distribution.source
labels are not cleared between tests and the busybox content still has
the distribution.source label pointing to the `dockercli/testf`
repository which is no longer present in the test registry.
So both `dockercli/busybox` and `dockercli/testf` are equally valid
mount candidates for `dockercli/crossrepopush` and containerd algorithm
just happens to select the last one.

This changes the repo name to not have the common repository component
(`dockercli`) with the `dockercli/testf` repository.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>

Paweł Gronowski authored on 2023/11/28 00:39:18
Showing 1 changed files
... ...
@@ -172,7 +172,7 @@ func (s *DockerRegistrySuite) TestConcurrentPush(c *testing.T) {
172 172
 }
173 173
 
174 174
 func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *testing.T) {
175
-	const sourceRepoName = privateRegistryURL + "/dockercli/busybox"
175
+	const sourceRepoName = privateRegistryURL + "/crossrepopush/busybox"
176 176
 
177 177
 	// tag the image to upload it to the private registry
178 178
 	cli.DockerCmd(c, "tag", "busybox", sourceRepoName)
... ...
@@ -185,7 +185,7 @@ func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *testing.T) {
185 185
 	digest1 := reference.DigestRegexp.FindString(out1)
186 186
 	assert.Assert(c, len(digest1) > 0, "no digest found for pushed manifest")
187 187
 
188
-	const destRepoName = privateRegistryURL + "/dockercli/crossrepopush"
188
+	const destRepoName = privateRegistryURL + "/crossrepopush/img"
189 189
 
190 190
 	// retag the image to upload the same layers to another repo in the same registry
191 191
 	cli.DockerCmd(c, "tag", "busybox", destRepoName)
... ...
@@ -194,7 +194,7 @@ func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *testing.T) {
194 194
 	assert.NilError(c, err, "pushing the image to the private registry has failed: %s", out2)
195 195
 
196 196
 	// ensure that layers were mounted from the first repo during push
197
-	assert.Assert(c, strings.Contains(out2, "Mounted from dockercli/busybox"))
197
+	assert.Assert(c, strings.Contains(out2, "Mounted from crossrepopush/busybox"))
198 198
 
199 199
 	digest2 := reference.DigestRegexp.FindString(out2)
200 200
 	assert.Assert(c, len(digest2) > 0, "no digest found for pushed manifest")