Skip to content

fix(watcher): treat locally built images as local under the containerd image store - #1512

Merged
scttbnsn merged 2 commits into
dev/v1.8from
fix/v1.8-containerd-local-images
Oct 29, 2026
Merged

scttbnsn merged 2 commits into
dev/v1.8from
fix/v1.8-containerd-local-images

Conversation

@scttbnsn

Copy link
Copy Markdown
Contributor

Fixes #1506.

With Docker's containerd image store, a locally built image gets a RepoDigests entry (myapp@sha256:...). drydock only treated an image as local when RepoDigests was empty, so it missed these and looked them up on Docker Hub every scan, logging a 401 each time.

Under the containerd store, moby builds RepoDigests as name@digest for every named image, pulled or not (daemon/containerd/image_inspect.go), so that list can't tell them apart. What can is the Identity field image inspect returns from API 1.53. It lists Pull sources from the distribution-source labels a pull leaves behind, and Build refs for local builds (daemon/containerd/image_identity.go).

The new docker-image-origin.ts decides in this order:

  1. Identity.Pull has entries: pulled.
  2. Identity present with no Pull: local.
  3. No Identity, but Descriptor is present (containerd store) on API 1.53 or newer: never pulled, so local. This covers docker load.
  4. Anything else, which means the classic store or an older API: the existing empty-RepoDigests rule, unchanged.

The API version comes from the version drydock already pins for socket watchers, or one cached version() call for remote hosts, and only when rule 3 needs it.

Local images still show in the UI. They just skip the registry lookup, same as on the classic store.

Tests cover inspect fixtures for a containerd local build, pull and load, containerd on API 1.52, and classic local and pulled.

cd app && npx vitest run --coverage.enabled=false watchers/providers/docker

…d image store

Fixes #1506. The containerd store reports name@digest in RepoDigests for every named image, local or pulled (moby collectRepoTagsAndDigests), so RepoDigests cannot tell them apart. On Engine API 1.53+ inspect carries Identity: a non-empty Pull means pulled, an Identity without Pull (Build or Signature only) means local, and no Identity on a containerd-store image (Descriptor present) means never pulled. Older APIs and the classic store keep the empty-RepoDigests rule.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 664afa3 and 3bf91a0.

Files ignored due to path filters: 1
  • CHANGELOG.md is excluded by !CHANGELOG.md
Files selected for processing: 4
  • app/watchers/providers/docker/docker-image-details-orchestration.test.ts
  • app/watchers/providers/docker/docker-image-details-orchestration.ts
  • app/watchers/providers/docker/docker-image-origin.test.ts
  • app/watchers/providers/docker/docker-image-origin.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Oct 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@scttbnsn
scttbnsn merged commit 05bbdab into dev/v1.8 Oct 29, 2026
59 of 61 checks passed
@scttbnsn
scttbnsn deleted the fix/v1.8-containerd-local-images branch October 29, 2026 02:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant