@@ -3,6 +3,8 @@ package validate
3
3
import (
4
4
"context"
5
5
"fmt"
6
+ "github.com/containers/image/v5/types"
7
+ "os"
6
8
"testing"
7
9
8
10
. "github.com/onsi/ginkgo/v2"
@@ -23,6 +25,27 @@ var _ = Describe("Check Catalog Consistency", func() {
23
25
images , err := utils .ParseImageRefsFromCatalog (catalogsPath )
24
26
Expect (err ).ToNot (HaveOccurred ())
25
27
Expect (images ).ToNot (BeEmpty (), "no images found" )
28
+ authPath := os .Getenv ("REGISTRY_AUTH_FILE" )
29
+
30
+ // Force image resolution to Linux to avoid OS mismatch errors on macOS,
31
+ // like: "no image found for architecture 'arm64', OS 'darwin'".
32
+ //
33
+ // Setting OSChoice = "linux" ensures we always get a Linux image,
34
+ // even when running on macOS.
35
+ //
36
+ // This skips the full multi-arch index and gives us just one manifest.
37
+ // To check all supported architectures (e.g., amd64, arm64, ppc64le, s390x),
38
+ // we’d need to avoid setting OSChoice and inspect the full index manually.
39
+ //
40
+ // TODO: Update this to support checking all architectures.
41
+ // See: https://issues.redhat.com/browse/OPRUN-3793
42
+ sysCtx := & types.SystemContext {
43
+ OSChoice : "linux" ,
44
+ }
45
+ if authPath != "" {
46
+ fmt .Println ("Using registry auth file:" , authPath )
47
+ sysCtx .AuthFilePath = authPath
48
+ }
26
49
27
50
for _ , url := range images {
28
51
name := utils .ImageNameFromRef (url )
@@ -31,7 +54,7 @@ var _ = Describe("Check Catalog Consistency", func() {
31
54
ctx := context .Background ()
32
55
By (fmt .Sprintf ("Validating image: %s" , url ))
33
56
34
- extractedImage , err := extract .UnpackImage (ctx , url , name )
57
+ extractedImage , err := extract .UnpackImage (ctx , url , name , sysCtx )
35
58
Expect (err ).ToNot (HaveOccurred ())
36
59
Expect (check .Check (ctx , extractedImage , check .AllChecks ())).To (Succeed ())
37
60
extractedImage .Cleanup ()
0 commit comments