Skip to content

Conversation

@piotrjanik
Copy link

@piotrjanik piotrjanik commented Dec 23, 2025

What this PR does / why we need it

This PR adds an --oci-layout flag to ocm download artifact and ocm download resources commands to produce OCI Image Layout compliant output.

Changes Introduced

New --oci-layout Flag

When specified, OCI artifacts are downloaded with:

  • Nested blob directories: blobs/sha256/<digest> instead of blobs/sha256.<digest>
  • OCI Image Layout files: index.json + oci-layout
  • Proper tagging: Resource version added to org.opencontainers.image.ref.name annotation

New Format Constant

Added FORMAT_OCI_COMPLIANT (oci/v1+compliant) which behaves like FORMAT_OCI but uses nested blob directory structure per OCI Image Layout specification.

Behavior

Command Without --oci-layout With --oci-layout
download artifact Flat blob paths Nested blob paths, OCI compliant
download resources Standard handlers OCI layout handler for OCI artifacts

ref.name Annotation

  • download artifact: Uses tag from source reference (e.g., latest)
  • download resources: Uses resource version

Fixes #1668

@github-actions github-actions bot added kind/bugfix Bug component/ocm-cli OCM Command Line Interface size/l Large labels Dec 23, 2025
@github-actions github-actions bot added the size/m Medium label Dec 23, 2025
<!-- markdownlint-disable MD041 -->
This change adds an optional --oci-layout flag to the
`ocm download artifacts` command to store blobs at
blobs/<algorithm>/<encoded> per OCI Image Layout Specification
instead of the default blobs/<algorithm>.<encoded> format.

This enables compatibility with tools that expect OCI-compliant
blob paths.

<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes open-component-model#1668

Signed-off-by: Piotr Janik <[email protected]>
<!-- markdownlint-disable MD041 -->
This change adds an optional --oci-layout flag to the
`ocm download artifacts` command to store blobs at
blobs/<algorithm>/<encoded> per OCI Image Layout Specification
instead of the default blobs/<algorithm>.<encoded> format.

This enables compatibility with tools that expect OCI-compliant
blob paths.

<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes open-component-model#1668

Signed-off-by: Piotr Janik <[email protected]>
@piotrjanik piotrjanik closed this Dec 30, 2025
@piotrjanik piotrjanik deleted the fix/oci-layout branch December 30, 2025 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ocm-cli OCM Command Line Interface kind/bugfix Bug size/l Large size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Downloading artifact leads to broken OCI image layout

1 participant