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>
This commit is contained in:
Paweł Gronowski 2023-11-27 16:39:18 +01:00
parent 2ef69899de
commit 9b399814e7
No known key found for this signature in database
GPG key ID: B85EFCFE26DEF92A

View file

@ -172,7 +172,7 @@ func (s *DockerRegistrySuite) TestConcurrentPush(c *testing.T) {
}
func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *testing.T) {
const sourceRepoName = privateRegistryURL + "/dockercli/busybox"
const sourceRepoName = privateRegistryURL + "/crossrepopush/busybox"
// tag the image to upload it to the private registry
cli.DockerCmd(c, "tag", "busybox", sourceRepoName)
@ -185,7 +185,7 @@ func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *testing.T) {
digest1 := reference.DigestRegexp.FindString(out1)
assert.Assert(c, len(digest1) > 0, "no digest found for pushed manifest")
const destRepoName = privateRegistryURL + "/dockercli/crossrepopush"
const destRepoName = privateRegistryURL + "/crossrepopush/img"
// retag the image to upload the same layers to another repo in the same registry
cli.DockerCmd(c, "tag", "busybox", destRepoName)
@ -194,7 +194,7 @@ func (s *DockerRegistrySuite) TestCrossRepositoryLayerPush(c *testing.T) {
assert.NilError(c, err, "pushing the image to the private registry has failed: %s", out2)
// ensure that layers were mounted from the first repo during push
assert.Assert(c, strings.Contains(out2, "Mounted from dockercli/busybox"))
assert.Assert(c, strings.Contains(out2, "Mounted from crossrepopush/busybox"))
digest2 := reference.DigestRegexp.FindString(out2)
assert.Assert(c, len(digest2) > 0, "no digest found for pushed manifest")