Skip to content

test(k8s): every image pin under k8s/ resolves in its registry before the merge #1994

Closed

Description

@dan-petty

Friction

Evidence

  • On 2026-10-23, docker buildx imagetools inspect with an empty Docker configuration resolved each of the nine images. A missing tag (ollama/ollama:0.0.0-does-not-exist) exited 1 with not found.
  • docker buildx is on the runner image (Docker-Buildx 0.38.0) and in the devcontainer. release.yml already uses imagetools. Skopeo 1.13.3 is also on the runner image.
  • Five of the eight images that are not managed are on Docker Hub. The anonymous pull limit of Docker Hub counts manifest GET requests. Nobody measured whether imagetools inspect sends a GET.
  • devops ci has no trigger files for one check. CheckSpec in src/devops_cli/commands/ci.py has no path field, and the cache holds one fingerprint for the whole gate. A registry check in devops ci thus asks the registries on each gate run, in the pre-push hook too.
  • check_argocd_gate already renders each Application on each pull request: test_this_repository_passes_the_argocd_gate runs it in Tests & Coverage in about 1 s. This contradicts the premise of ci(k8s): the Argo CD build gate runs in devops ci on every change to k8s #1860.
  • The docker CLI is a faked edge with no shared fake and no contract suite yet (docs/TESTING.md, "Not yet").

Proposed remedy

  • A job of ci.yml, scoped like docs-site: a dorny/paths-filter step on k8s/** and ci.yml, with contents: read and pull-requests: read. It is not a row of devops ci, so no local gate run reaches a registry.
  • The job runs a devops command. The command renders each Application with the discovery of check_argocd_gate, takes each image value from the rendered documents and skips the names that the ImageUpdater object lists.
  • It resolves each image once with docker buildx imagetools inspect and fails with the image, the Application and the registry. First, measure on the runner whether Docker Hub counts the request. Use kbld only if it does better.
  • The tests use a shared fake of the docker CLI with a contract suite over recorded output, as docs/TESTING.md requires.

Open questions

  • Must the check also cover the images that Helm charts render? check_argocd_gate does not render charts.

Proposed design

Problem statement

The image pins under k8s/ are not verified before a pull request merges. A wrong tag fails only when Argo CD syncs. A CI job must resolve each image in its registry before the merge, skipping the images that the ImageUpdater object manages.

Acceptance criteria

  • Criterion 1: A job in ci.yml triggers on changes to k8s/** or ci.yml.
    Verification: Read the dorny/paths-filter step of the job in ci.yml.
  • Criterion 2: The job sets contents: read and pull-requests: read.
    Verification: Read the permissions: block of the job in ci.yml.
  • Criterion 3: The command renders each Application and lists each image value.
    Verification: Run the command and confirm it lists the image values from the rendered Applications.
  • Criterion 4: The command skips images that the ImageUpdater object lists.
    Verification: Run the command and confirm ghcr.io/dan-petty/devops-cli/service:latest is absent from the resolve list.
  • Criterion 5: The command resolves each image with docker buildx imagetools inspect.
    Verification: Run the command with a valid image. Confirm it exits 0.
  • Criterion 6: On failure, the command names the image, the Application, and the registry.
    Verification: Run the command with an invalid image. Confirm the output names the image, Application, and registry.
  • Criterion 7: A shared fake of the docker CLI exists in tests/support/fakes/.
    Verification: Confirm the file exists and a test imports it.
  • Criterion 8: The fake has a contract suite over recorded output.
    Verification: Run the contract suite tests. Confirm they pass.

Key questions

  • Must the check also cover the images that Helm charts render?: No. The command renders Applications via check_argocd_gate discovery and extracts images from those rendered documents. check_argocd_gate does not render charts, so the check does not cover Helm chart images. (proposed)

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/test
    scope/k8s
    on Oct 23, 2026
  2. dan-petty commented on Oct 24, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Priority: P2-Medium. The change improves CI reliability but is not critical for immediate release.
    • Value: Medium. The change prevents runtime failures from invalid image tags in k8s manifests.
    • Effort: Medium. Requires implementing a new job with docker buildx imagetools inspect and handling ImageUpdater exclusions.
    • Related: ci(k8s): the Argo CD build gate runs in devops ci on every change to k8s #1860, which asks for a different change. Both items work on k8s image resolution but the candidate checks images before merge while item 1860 runs the Argo CD gate in devops ci.
  3. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at bb46660 (see proposed design in issue body).

  4. added
    priority/p2-medium
    status/ready
    value/medium
    effort/medium
    on Oct 28, 2026
  5. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/k8stype/testvalue/medium

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions