Skip to content

Cache images pulled by digest only in LocalImagesCache - #12131

Open
Chaitanya060 wants to merge 1 commit into
testcontainers:mainfrom
Chaitanya060:fix/local-images-cache-digest
Open

Chaitanya060 wants to merge 1 commit into
testcontainers:mainfrom
Chaitanya060:fix/local-images-cache-digest

Conversation

@Chaitanya060

@Chaitanya060 Chaitanya060 commented Oct 25, 2026 •

Copy link
Copy Markdown

Summary by CodeRabbit

  • Bug Fixes
    • Improved local image lookup so images can be found by either their repository tag or digest, including images that have a digest but no tag.
    • Prevented empty or placeholder image names from being added to the cache, and avoided duplicate entries when an image has multiple matching names.

@Chaitanya060
Chaitanya060 requested a review from a team as a code owner October 25, 2026 06:33
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ef292777-e8e4-446d-8ec5-e97059facc5c
Commits

Reviewing files that changed from the base of the PR and between f74d167 and adb9ab7.

Files selected for processing: 2
  • core/src/main/java/org/testcontainers/images/LocalImagesCache.java
  • core/src/test/java/org/testcontainers/images/LocalImagesCacheTest.java

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

LocalImagesCache now indexes images by repository tags and digests. Tests cover digest-only images, images with both names, and images with neither.

Changes: Local image cache

Layer / File(s) Summary
Index tags and digests
core/src/main/java/org/testcontainers/images/LocalImagesCache.java, core/src/test/java/org/testcontainers/images/LocalImagesCacheTest.java
populateFromList processes repository tags and digests. The new helper skips null arrays, filters names beginning with <none>, and caches distinct names. Tests cover images with a digest only, both a tag and digest, or neither.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: bsideup

Merge Risk: Minimal · up to adb9a

The cache supports digest-only images, and the remaining combined-name case falls back correctly. No merge-blocking issue was found.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description contains only the standard template comments. It does not explain the changed behavior, the previous problem, the fix, or validation results. Add a brief description of the change. Explain the broken behavior, how LocalImagesCache now handles repository digests, and how the change was tested. Reference an issue if applicable.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: caching images pulled only by digest in LocalImagesCache.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
  • 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.

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