feat(image): support pinning qdrant image by digest - #457
Open
unique-jakub wants to merge 1 commit into
Open
Conversation
Adds a new `image.digest` value and two helper templates so that users can reference the qdrant container image by SHA256 digest for immutable, content-addressed pulls (closing the gap reported in qdrant#388). Behaviour: * When `image.digest` is set, the container is rendered as `repository@digest` and the digest takes precedence over `image.tag` and the `-unprivileged` suffix. Users wanting the unprivileged variant must supply the digest of that variant. * The new `qdrant.image.semver` helper strips an optional `@sha256:...` suffix from `image.tag` (this is the form Renovate emits when it digest-pins a Helm value) before the readiness-probe path's `semverCompare ">=1.7.3"` check, so chart logic that depends on the qdrant version keeps working when callers use the combined notation. * Default behaviour is unchanged: with `digest` empty the chart still renders `repository:tag[-unprivileged]`. Tests: extends the unit suite with `TestImageDigestPinning` covering digest-only, digest+tag, digest+useUnprivilegedImage, and the `tag@sha256:` notation for both >=1.7.3 and <1.7.3 readiness paths.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #388.
What
Add support for pinning the qdrant container image by SHA256 digest, so that the chart can render
repository@sha256:<digest>and provide immutable, content-addressed pulls.Why
Tag-based image references are mutable: anyone with push access to the registry can replace the image behind a tag without changing the tag itself. Digest pinning is a standard supply-chain mitigation but is currently impossible with this chart because:
"{{ repo }}:{{ tag }}", so the only way for a user to pass a digest is to stufftag@sha256:...intoimage.tag.templates/statefulset.yamlthen passesimage.tagdirectly tosemverCompare ">=1.7.3"to pick the readiness probe path, which fails witherror calling semverCompare: invalid semantic versiononce the tag contains@sha256:.This PR makes the chart digest-aware on both fronts.
Changes
values.yamlA new optional field:
templates/_helpers.tplTwo new helpers:
qdrant.image— rendersrepository@digestwhenimage.digestis set, otherwiserepository:tag[-unprivileged]. Used for both the main container and theensure-dir-ownershipinitContainer.qdrant.image.semver— extracts the semver portion ofimage.tagforsemverCompare. It strips any@sha256:…suffix (the form Renovate emits when it digest-pins a Helm value) and falls back toChart.AppVersionwhen the tag is empty.templates/statefulset.yamlThree call sites updated to use the new helpers:
image:→{{ include "qdrant.image" . }}ensure-dir-ownershipinitContainerimage:→{{ include "qdrant.image" . }}semverCompare→ usesinclude "qdrant.image.semver" $Behaviour matrix
image.tagimage.digestuseUnprivilegedImagesemverCompareinput""(default)""falserepo:<Chart.AppVersion><Chart.AppVersion>v1.6.0""truerepo:v1.6.0-unprivilegedv1.6.0""sha256:abcfalserepo@sha256:abc<Chart.AppVersion>v1.17.1sha256:abcfalserepo@sha256:abcv1.17.1v1.17.1@sha256:abc""falserepo:v1.17.1@sha256:abc(valid OCI)v1.17.1Default behaviour is unchanged — with
digestempty the chart still rendersrepository:tag[-unprivileged]exactly as before.When both
digestanduseUnprivilegedImageare set, the digest takes precedence; users wanting the unprivileged variant must supply the digest of that variant. This is documented inline invalues.yaml.Tests
helm lint charts/qdrantpasses.go test ./test/passes the entire existing suite plus a newTestImageDigestPinningthat covers:repository@digestrepository@digestuseUnprivilegedImagetag@sha256:notation strips the digest fromsemverCompare(>=1.7.3 path)tag@sha256:notation respects pre-1.7.3 readiness pathI left
Chart.yaml/CHANGELOG.mduntouched since perCONTRIBUTING.mdthose are bumped during release. Happy to add the changelog entry if you'd like it in this PR.