feat(supervisor): optional image registry rewrite for run pods - #4667
Conversation
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 7 remain after this review. 📜 Recent review details⏰ Context from checks skipped due to timeout. (6)
WalkthroughAdds optional environment variables for Kubernetes image registry rewriting. Adds Merge Risk: ⚪ Minimal · up to This adds an opt-in image registry rewrite without changing default behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
a36be18 to
4745a29
Compare
Adds an optional registry rewrite for run pod images, so a supervisor can pull a run's image from a registry host of your choosing.
Off by default and inert unless both ends are set:
When both are set, a run pod image whose host matches
FROMhas that host replaced withTO; everything after the host - repository, tag, digest - is untouched. Anything else passes through unchanged. It sits beside the existingKUBERNETES_STRIP_IMAGE_DIGESTtransform and follows the same shape.The rewrite is applied where the pod spec is built, so the final host is present in the spec from the start and image pull credentials resolve against the host that is actually contacted.
Matching
The match is an exact host-prefix test (
FROMfollowed by/), not a regex, so a look-alike host cannot be matched by accident:Tests
imageRegistry.test.tscovers the rewrite, digest preservation, both half-configured cases, unrelated registries, and the two host-boundary cases above.The rewrite lives in its own module rather than in
kubernetes.ts, because that module parses the environment at import time and a unit test cannot satisfy that.Verified with
vitest run ./src/workloadManager/(30 tests across 3 files), plustypecheck --filter supervisor,formatandlint. The boundary assertion was mutation-checked - relaxing the match to a bare prefix makes it fail - so it is not passing by construction.No changeset or
.server-changes/note: this is off by default and changes nothing a user would notice.