Skip to content

Conversation

@jakobmoellerdev
Copy link
Member

@jakobmoellerdev jakobmoellerdev commented Oct 14, 2025

What this PR does / why we need it

Refactored ComponentVersionContainer to allow fetching OCI manifests from top level OCI Image indexes. This is preparation for allowing the reference of native OCI Manifests that are themselves referenced via index first. This is prep work to allow native storage in OCI registries for local blobs that might themselves be stored previously as OCM Artifact Sets. They could now be accessed natively instead.

Which issue(s) this PR is related to

This allows native reading of OCM Artifacts created with the new v2 library that can use indexes to store artifacts natively

final stepping stone to prepare ADR for open-component-model/ocm-project#680
fixes open-component-model/ocm-project#717

@github-actions github-actions bot added kind/feature new feature, enhancement, improvement, extension size/m Medium component/ocm-spec Open Component Model Specification labels Oct 14, 2025
Refactored `ComponentVersionContainer` to allow fetching OCI manifests from top level OCI Image indexes. This is preparation for allowing the reference of native OCI Manifests that are themselves referenced via index first. This is prep work to allow native storage in OCI registries for local blobs that might themselves be stored previously as OCM Artifact Sets. They could now be accessed natively instead.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Added support to synthesize artifact blobs for nested OCI image manifests or indexes in cases where fewer references are provided. Updated error handling and blob synthesis logic accordingly.

Signed-off-by: Jakob Möller <jakob.moeller@sap.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
@jakobmoellerdev jakobmoellerdev force-pushed the index-based-oci-artifacts branch from 738a236 to 7ce6b75 Compare November 12, 2025 13:57
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
@github-actions github-actions bot added the kind/dependency dependency update, etc. label Dec 18, 2025
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
@github-actions github-actions bot added component/ocm-cli OCM Command Line Interface size/l Large labels Dec 18, 2025
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
@jakobmoellerdev jakobmoellerdev force-pushed the index-based-oci-artifacts branch from 2e9d7c1 to 9f95f98 Compare December 22, 2025 14:25
@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review December 22, 2025 15:11
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner December 22, 2025 15:11
// Build complete tag set from:
// - existing TAGS_ANNOTATION on any descriptor for this digest
// - incoming tags
tagSet := map[string]struct{}{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can see this could also be just a []string. Am I missing something?

Comment on lines +209 to +212
isOCI := a.base.FileSystemBlobAccess.
Access().
GetInfo().
GetDescriptorFileName() == OCIArtifactSetDescriptorFileName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just structure-wise - this variable could be set right before it is used on L256

if template.Annotations == nil {
template.Annotations = map[string]string{}
} else {
template.Annotations = maps.Clone(template.Annotations)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cloning the map template.Annotations to template.Annotations looks odd. What is the reasoning?

Comment on lines +46 to +50
if m.spec.MediaType == artdesc.MediaTypeImageIndex || m.spec.MediaType == artdesc.MediaTypeImageManifest {
// if we discover a localblob with an index or manifest media type, we can
// assume that we are dealing with a new style of artifact created by the new reference library.
m.mimeType = artifactset.MediaType(m.spec.MediaType)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if the localblob would be an actual OCI artifact? This would not make a difference as the new reference library creates its artifact in the OCI layout, right?

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 component/ocm-spec Open Component Model Specification kind/dependency dependency update, etc. kind/feature new feature, enhancement, improvement, extension size/l Large size/m Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extension of Read Only Support for Index Based OCI Artifacts in OCM CLI

2 participants