feat: Add image name substitution hook#1710
Conversation
✅ Deploy Preview for testcontainers-dotnet ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
WalkthroughA new ChangesImage Name Substitution
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsStopped waiting for pipeline failures after 30000ms. One of your pipelines takes longer than our 30000ms fetch window to run, so review may not consider pipeline-failure results for inline comments if any failures occurred after the fetch window. Increase the timeout if you want to wait longer or run a 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. Comment |
What does this PR do?
Adds
TestcontainersSettings.ImageNameSubstitution, aFunc<IImage, IImage>hook that lets users replace any image name before it is pulled. This is the .NET equivalent of Java'sImageNameSubstitutor.The substitution runs before the existing
HubImageNamePrefixis applied, so both mechanisms can be combined. Returningnullfrom the function falls back to the original image name./cc @scrocquesel-ml150
Why is it important?
This helps users to redirect image pulls to a private registry mirror (e.g., to avoid Docker Hub rate limits), apply custom routing rules that go beyond simple prefix matching, and audit or restrict which container images can be used in a build.
Related issues
Summary by CodeRabbit
New Features
Documentation