Fix the "missing image" check when reading oci:

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
This commit is contained in:
Miloslav Trmač
2025-05-28 22:26:25 +02:00
parent 40353ad7eb
commit 634c0d99f3
3 changed files with 14 additions and 1 deletions

View File

@@ -497,6 +497,8 @@ func (s *copySuite) TestCopySimple() {
assertSkopeoSucceeds(t, "", "copy", "docker://registry.k8s.io/pause:latest", "oci:"+ociDest+":"+ociImgName)
_, err := os.Stat(ociDest)
require.NoError(t, err)
// copy exits with status 2 if the image is not found within the container, in some transports.
assertSkopeoFailsWithStatus(t, 2, "copy", "oci:"+ociDest+":thisdoesnotexist", "dir:"+t.TempDir())
// docker v2s2 -> OCI image layout without image name
ociDest = "pause-latest-noimage"