-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Objective
Enable the legacy ocm CLI to discover and read OCM component versions stored as OCI Image Indexes instead of top-level manifests, preserving compatibility with new repository formats introduced in the “Future Format Considerations” proposal.
Scope
Add read-only support for index-based component versions to the api/ocm/extensions/repositories/genericocireg package and associated CLI commands (ocm get componentversion, ocm download resource, etc.).
Writing (publishing) to the index-based format is out of scope.
Deliverables
-
Index Detection and Resolution
-
Modify
genericocireg.RepositoryAccessto:- Detect when the top-level descriptor is an
application/vnd.oci.image.index.v1+json. - Iterate over index manifests to locate the manifest matching the component version tag or matching annotations (
org.opencontainers.image.ref.name). - Use that manifest as the component descriptor source.
- Detect when the top-level descriptor is an
-
Fallback: if no match, continue using the existing manifest-based logic.
-
-
Artifact Reading Compatibility
- Extend
AccessSpechandling to supportlocalBlobentries wheremediaType∈ {application/vnd.oci.image.manifest.v1+json,application/vnd.oci.image.index.v1+json}. - On read, synthesize an ArtifactSet from native OCI manifests to maintain backward compatibility with existing consumers (as in PR #1646).
- Ensure that
globalAccess(when present) is exposed transparently without breaking current resolution logic.
- Extend
-
CLI Integration
-
Update read commands to use the new resolution path:
ocm get componentversionocm get resourceocm download resource
-
Ensure transparent behavior: user input and flags remain unchanged.
-
-
Tests
-
Add integration tests for:
- Reading a manifest-based component version (baseline).
- Reading an index-based component version referencing a descriptor manifest.
- Reading resources with
localBlobreferencing a native OCI Artifact.
-
Validate equivalence of
ocm getoutput and artifact set synthesis results.
-
-
Documentation
-
Update CLI help text and
docs/extension-oci.md:- Describe support for index-based discovery.
- Clarify read-only limitation.
-
Add a migration note for future write support.
-
Acceptance Criteria
-
ocmcan list and retrieve component versions from OCI repositories where the top-level object is an Image Index. - Resources with
localBloband OCI media types can be read and exported correctly. - Existing manifest-based component versions remain unaffected.
- All new code paths are covered by unit/integration tests.
- Documentation updated and validated.
Implementation References
- api/ocm/extensions/repositories/genericocireg
- Proposed PR #1646 for initial prototype logic
- OCI Image Index Specification
Metadata
Metadata
Assignees
Labels
Type
Projects
Status