Repository navigation
Description
Update 2026-11-26 (infra move): the images to pin are in dan-petty/homelab.
The third-party images of k8s/devops/ already have a digest. This issue keeps the devops k8s image-pins refusal. .github/renovate/base.json is gone: set pinDigests for kubernetes, helm-values and argocd in renovate/k8s.json of dan-petty/infra. The gateway, Valkey, PostgreSQL and Qdrant pins are homelab work.
Follow-up: dan-petty/homelab#307.
Problem
Row SEC-4 of the production readiness guideline pins an image by digest. The third-party images of k8s/llm/ name a tag only: the LiteLLM gateway, Portkey, the three Valkey instances and their redis_exporter, the PostgreSQL image of the CloudNativePG cluster llm-gateway-db, and the Qdrant image that its Helm chart sets. A registry can move a tag, so two pulls of one tag can give two images.
devops k8s image-pins (CI job image-pins) refuses only an image with no digest and the tag latest or no tag, so a fixed tag passes. Renovate sets pinDigests only for the managers github-actions and dockerfile (.github/renovate/base.json), so it writes no digest into a manifest or a Helm value.
Expected behavior
- Each third-party image of
k8s/devops/names a tag and a digest (<image>:<tag>@sha256:<digest>), and Renovate updates both, for example withpinDigestsfor the managerskubernetes,helm-valuesandargocd. devops k8s image-pinsrefuses a third-party image with no digest, and names the exceptions that Argo CD Image Updater moves.- No test repeats a digest (test(k8s): Drop the tests that repeat third-party version pins #6060).
Related
- feat(deps): track regular version updates with Renovate #4893 (Renovate tracker), test(k8s): Drop the tests that repeat third-party version pins #6060, docs(service): Write the service design pattern standards #6059 (service pattern SC5).
Alternatives check of 2026-11-24: in-use.
The repository already uses this tool.
Tool: renovatebot/renovate (https://github.com/renovatebot/renovate), AGPL-3.0, last activity 2026-11-24, maintained.
Reason: Searches found Renovate as the maintained dependency automator that pins and updates image tags and digests in manifests and Helm values; it covers the automated pinning half, but the in-repo refusal check and the Argo CD Image Updater exceptions remain project code.
Covers:
- Sets pinDigests for the kubernetes, helm-values and argocd managers
- Updates tag and digest together in one pull request
- Rewrites Helm values and Argo CD image references
Lacks:
- No in-repo refusal of a digestless third-party image
- No named Argo CD Image Updater exceptions
- No rule that tests avoid repeating a digest
Proposed design
Problem statement
devops k8s image-pins must refuse a third-party image with no digest and name the images that Argo CD Image Updater moves. A registry can move a tag, so two pulls of one tag can give two images. The current check refuses only the latest tag or no tag, so a fixed tag passes. The homelab images are follow-up dan-petty/homelab#307. The Renovate pin rules of dan-petty/infra are deferred.
Acceptance criteria
Requirement: A fixed tag with no digest fails
devops k8s image-pins SHALL fail when a third-party image names a tag and no digest.
Scenario: A fixed tag with no digest fails
- WHEN
uv run pytest tests/k8s/test_image_pins.py -qruns its case with a tree whose Deployment namesexample.com/team/app:1.2.3and no digest. - THEN The test passes, the command exits 1, and its output names the image, its Application and the missing digest.
Requirement: A tag with a digest passes
devops k8s image-pins SHALL accept a third-party image that names a tag and a sha256 digest.
Scenario: A tag with a digest passes
- WHEN
uv run pytest tests/k8s/test_image_pins.py -qruns its case with a tree whose Deployment namesexample.com/team/app:1.2.3and the digest thattests/fixtures/image_pins/digests.yamlgives forapp. - THEN The test passes, the command exits 0, and its output names the image as a pin.
Requirement: An updater image is named, not refused
devops k8s image-pins SHALL name each image that Argo CD Image Updater moves and SHALL not fail it for a missing digest.
Scenario: An updater image is named
- WHEN
uv run pytest tests/k8s/test_image_pins.py -qruns its case with--managed ghcr.io/example/serviceand a tree whose imageghcr.io/example/servicehas no tag. - THEN The test passes, the command exits 0, and its output lists the image under the Argo CD Image Updater exceptions.
Requirement: A cluster-only registry image is named, not refused
devops k8s image-pins SHALL not fail an image of a cluster-only registry for a missing digest and SHALL name it.
Scenario: A cluster-only image is named
- WHEN
uv run pytest tests/k8s/test_image_pins.py -qruns its case with a tree whose image isregistry.example.svc:5000/team/tool:1.0. - THEN The test passes, the command exits 0, and its output names the image as a cluster-only registry image.
Requirement: One copy of each test digest
The image-pins tests SHALL read each sha256 digest from tests/fixtures/image_pins/digests.yaml and SHALL hold no digest literal.
Scenario: The test sources hold no digest literal
- WHEN
uv run pytest tests/invariants/test_image_pin_digests.py -qscanstests/k8s/test_image_pins.pyfor the patternsha256:[0-9a-f]{64}. - THEN The test passes and reports no match.
Requirement: The image-pins CI job passes
The image-pins CI job SHALL pass and SHALL name each Argo CD Image Updater exception of k8s/devops.
Scenario: The image-pins CI job passes
- WHEN The
image-pinsCI job runs on the repository. - THEN The job passes and its log names each Argo CD Image Updater exception of
k8s/devops.
Existing Tool Considered
Renovate (renovatebot/renovate), verdict in-use. The alternatives check in the issue body gives what the tool covers and lacks. The proposal uses Renovate for the tag and digest updates. It adds what Renovate lacks: the in-repo refusal in devops k8s image-pins, the named Argo CD Image Updater exceptions, and the single copy of each test digest.
Key questions
- Which images must name a digest?: A third-party image must name a tag and a
sha256digest. The check does not require a digest of an image of a cluster-only registry, because no runner reads that registry. The check does not require a digest of an image that Argo CD Image Updater moves, and it names that image. (best practice) [sources: src/devops_cli/k8s/image_pins.py, tests/k8s/test_image_pins.py]- Rejected: Require a digest of each third-party image except the updater images. It fails an image of a cluster-only registry that no runner can resolve.
- Chosen: Require a digest of each third-party image, except the cluster-only and updater images. It pins each image that a public registry holds, and it keeps the two sets that the check already reads.
- Rejected: Keep the current rule and refuse only the
latesttag or no tag. A fixed tag can move, which is the problem that the issue states.
- How does the check learn which images Argo CD Image Updater moves?: The check keeps its two sources: an
ImageUpdaterobject in the render and the--managed <repository>option. It reports each image from those sources as an exception with no error. (best practice) [sources: src/devops_cli/k8s/image_pins.py, tests/k8s/test_image_pins.py, tests/fixtures/image_pins/chart_render.yaml]- Chosen: Reuse the
ImageUpdaterobjects and the--managedoption. The check already reads both, and a test shows each source. - Rejected: An explicit exception set in the check. It duplicates the sources that the render and the option already give.
- Rejected: A separate config file. It adds a file and a loader for a list that the check already builds.
- Chosen: Reuse the
- What does the refusal message say?: The message names each image with no digest, its Applications, and the missing digest. It does not say that the image uses the
latesttag. (best practice) [sources: tests/k8s/test_image_pins.py]- Chosen: A new message that names the missing digest. It states the defect of a fixed tag and of a
latesttag. - Rejected: Reuse the
latestmessage. It says the image uses thelatesttag, which is false for a fixed tag. - Rejected: One message for the two cases with no image name. The reader cannot find the image that fails.
- Chosen: A new message that names the missing digest. It states the defect of a fixed tag and of a
- Where do the tests get each digest?: The tests read each digest from
tests/fixtures/image_pins/digests.yaml, which holds it once. No test holds asha256literal, as test(k8s): Drop the tests that repeat third-party version pins #6060 asks. (best practice) [sources: tests/k8s/test_image_pins.py, tests/fixtures/image_pins/chart_render.yaml]- Chosen: One fixture that holds each digest once. One copy, and an image update changes one line.
- Rejected: A literal in each test. It repeats a digest, which test(k8s): Drop the tests that repeat third-party version pins #6060 forbids.
- Rejected: Read the digests from the committed
k8s/devopsmanifests. It couples a unit test to the product base.
- How does the chart render fixture give a pinned image?:
_chart_answersadds the digest fromtests/fixtures/image_pins/digests.yamlto the Alertmanager image of the render. The chart render fixture keeps the tag only, so the digest has one copy. (best practice) [sources: tests/k8s/test_image_pins.py, tests/fixtures/image_pins/chart_render.yaml]- Chosen: Add the digest in the test from the digest fixture. The digest stays in one file.
- Rejected: Write the digest into
chart_render.yaml. It makes a second copy of the digest. - Rejected: Keep the tag only and let the render fail. The chart tests would fail on a valid chart.
- Which images does the check scan?: The check keeps its scope: the rendered Applications of the environment tree, or the kustomization folder that the argument names. The new refusal applies to each image in that scope. (best practice) [sources: src/devops_cli/k8s/image_pins.py, tests/k8s/test_image_pins.py]
- Chosen: Keep the rendered scope. It reads the Helm values and the Argo CD references that a raw file scan misses.
- Rejected: Scan the raw files of
k8s/. It misses a tag that a chart value file sets. - Rejected: Scan only
k8s/devops. The check serves each environment tree, not only the product base.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 16, 2026
Both pin images in k8s manifests, but #5135 pins the product base to a release tag while this candidate pins third-party images by digest.dan-petty commentedon Nov 17, 2026
Pull request #6112 (for #6068) runs kube-linter in CI. Today 7 third-party images of the path sources name no digest:
cloudflare/cloudflared,ghcr.io/berriai/litellm,ghcr.io/oliver006/redis_exporter,mattermost/mattermost-team-edition,nvcr.io/nvidia/k8s-device-plugin,portkeyai/gatewayandvalkey/valkey. After this item pins them, a custom check of.kube-linter.yamlfrom the templatelatest-tagwith anallowListof.*@sha256:[0-9a-f]{64}$keeps each new image pinned. The 3 images that Argo CD Image Updater sets then need the annotation of that check too, as they holdignore-check.kube-linter.io/latest-tagnow.fix(k8s): Run kube-linter on the Argo CD builds in CI (#6112)
devops-cli-service commentedon Nov 18, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (5)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 18, 2026
Status set to Ready at 4ddf77e (see proposed design in issue body).
devops-cli-service commentedon Nov 27, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
chore(main): release 0.251.0 (#7782)
devops-cli-service commentedon Nov 29, 2026
Released in v0.251.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.251.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 18:59 UTC