Skip to content

Commit eddfb2b

Browse files
committed
prefix value with oci-layout
Signed-off-by: Jeff Rescignano <jeffr@defenseunicorns.com>
1 parent cd70e2a commit eddfb2b

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

pkg/attestation/crafter/materials/oci_image.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ func (i *OCIImageCrafter) isOCILayoutPath(path string) bool {
314314
}
315315

316316
// Check for oci-layout file
317-
layoutFile := filepath.Join(path, "oci-layout")
317+
layoutFile := filepath.Join(path, ociLayoutRepoName)
318318
if _, err := os.Stat(layoutFile); err != nil {
319319
return false
320320
}
@@ -395,10 +395,17 @@ func (i *OCIImageCrafter) buildMaterialFromManifest(layoutPath string, manifest
395395
digest := manifest.Digest.String()
396396

397397
// Extract repository name from annotations if available
398-
repoName := ociLayoutRepoName
398+
repoName := ociLayoutRepoName + ":"
399399
if manifest.Annotations != nil {
400-
if name, ok := manifest.Annotations["org.opencontainers.image.ref.name"]; ok {
401-
repoName = name
400+
// Try annotation keys in preference order
401+
for _, key := range []string{
402+
"org.opencontainers.image.ref.name",
403+
"org.opencontainers.image.base.name",
404+
} {
405+
if name, ok := manifest.Annotations[key]; ok {
406+
repoName = repoName + name
407+
break
408+
}
402409
}
403410
}
404411

0 commit comments

Comments
 (0)