-
Notifications
You must be signed in to change notification settings - Fork 31
feat: support index based reading of OCI artifacts #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: support index based reading of OCI artifacts #1646
Conversation
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>
738a236 to
7ce6b75
Compare
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>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
Signed-off-by: Jakob Möller <contact@jakob-moeller.com>
2e9d7c1 to
9f95f98
Compare
| // Build complete tag set from: | ||
| // - existing TAGS_ANNOTATION on any descriptor for this digest | ||
| // - incoming tags | ||
| tagSet := map[string]struct{}{} |
There was a problem hiding this comment.
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?
| isOCI := a.base.FileSystemBlobAccess. | ||
| Access(). | ||
| GetInfo(). | ||
| GetDescriptorFileName() == OCIArtifactSetDescriptorFileName |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
| 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) | ||
| } |
There was a problem hiding this comment.
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?
What this PR does / why we need it
Refactored
ComponentVersionContainerto 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