-
Notifications
You must be signed in to change notification settings - Fork 205
feat(hip): OCI Artifact Selection and Referrers Support #424
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?
Conversation
This HIP proposes enabling Helm to: 1. Select chart manifests from OCI Image Index by artifactType 2. Set artifactType field when pushing charts 3. Support Referrers API via --subject flag Addresses helm/helm#31582 Co-Authored-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
|
|
||
| When `helm pull`, `helm install`, or `helm dependency update` encounters an OCI reference that resolves to an Image Index (`application/vnd.oci.image.index.v1+json`), Helm MUST select a chart manifest using the following algorithm: | ||
|
|
||
| 1. **First pass**: Iterate through descriptors in `manifests[]` and check for `artifactType: application/vnd.cncf.helm.config.v1+json` |
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.
I wasn't around for the helm OCI implementation, so I don't know the thinking, but I assumed application/vnd.cncf.helm.config.v1+json represented the format of the config blob. If that is the case, it is almost as if there would need to be a new type something like application/vnd.cncf.helm.manifest.v1+json
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.
You're correct that application/vnd.cncf.helm.config.v1+json represents the config blob format. However, using the same value for artifactType is intentional per OCI spec.
The OCI Image Spec (descriptor.md) explicitly defines artifactType in Index descriptors as:
"This is the value of the config descriptor
mediaTypewhen the descriptor references an image manifest."
This design allows clients to select manifests from an Image Index without fetching them first - the artifactType in the descriptor tells you what kind of artifact it is by exposing the config.mediaType value at the Index level.
So the equality artifactType == config.mediaType is by design, not a naming collision:
- In Image Index descriptor:
artifactType= identifier for selection - In Image Manifest:
config.mediaType= format of the config blob
Both happen to have the same value because OCI spec defines it that way. Creating a separate type like application/vnd.cncf.helm.manifest.v1+json would contradict the OCI artifact model and require IANA registration for no functional benefit.
Reference: https://github.com/opencontainers/image-spec/blob/main/descriptor.md#properties
| 2. **Second pass** (fallback): If no match in first pass, iterate through descriptors WITHOUT a `platform` field: | ||
| - Fetch the referenced manifest | ||
| - Check if `config.mediaType` equals `application/vnd.cncf.helm.config.v1+json` | ||
| - If exactly one manifest matches, select it |
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.
I would think this would search for the first layer mediaType that is application/vnd.cncf.helm.chart.content.v1.tar+gzip
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.
Layer mediaTypes are not exposed in Image Index descriptors - only these fields are available at the Index level:
mediaType(of the manifest itself, alwaysapplication/vnd.oci.image.manifest.v1+json)digest,sizeplatform(for container images)artifactType(for artifacts, OCI 1.1+)annotations
To check layers[].mediaType, we would need to fetch every manifest in the Index first, then inspect each one. This defeats the purpose of efficient artifact selection.
The OCI artifact model specifically uses artifactType (derived from config.mediaType) because it's available at the Index level without additional round-trips.
Example Index descriptor:
{
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"digest": "sha256:def456...",
"size": 567,
"artifactType": "application/vnd.cncf.helm.config.v1+json"
// layers[] is NOT here - it's inside the manifest
}The fallback path (checking config.mediaType when artifactType is absent) already requires fetching the manifest. Adding layer inspection would not improve selection accuracy but would add complexity.
Address review feedback from TerryHowe: - Explain why artifactType equals config.mediaType (per OCI spec) - Explain why layer mediaType cannot be used for selection Co-Authored-By: Claude <[email protected]> Signed-off-by: Aleksei Sviridkin <[email protected]>
Summary
This HIP proposes three related enhancements to Helm's OCI support:
Artifact Selection from Image Index - Enable
helm pull/install/dependencyto select chart manifests from OCI Image Index byartifactType(withconfig.mediaTypefallback)Set
artifactTypeon Push - Havehelm pushset theartifactTypefield in manifests for efficient selectionReferrers API Support - Add
--subjectflag tohelm pushfor associating charts with container imagesMotivation
Current workarounds for publishing charts and images together (tag suffixes like
:v1.0.0-helm, separate paths) are unnecessary complexity. OCI 1.1 provides native artifact bundling - Helm should leverage it.Related
Checklist