feat: add Image and ResolvedImage fields to SwarmOpts#392
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR extends the SwarmOpts data model with image-related fields (Image and ResolvedImage) and introduces a precedence-based image resolution helper for the orchestrator. The resolveInstanceImages method implements a three-tier strategy: use explicit user overrides, fall back to stored resolved images, or lazy-backfill from the version manifest. Both the data model and resolution logic are comprehensively tested. ChangesImage Resolution and SwarmOpts Enhancement
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)
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 |
Up to standards ✅🟢 Issues
|
| Category | Results |
|---|---|
| Complexity | 1 medium |
🟢 Metrics 0 duplication
Metric Results Duplication 0
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Summary
This PR adds
ImageandResolvedImagefields toSwarmOptsand implements precedence-based image resolution in the Swarm orchestrator. This provides the foundation for user-controlled image overrides and stable image pinning.Changes
Image(user override, never managed by CP) andResolvedImage(CP-managed) fields toSwarmOptsinserver/internal/database/spec.go, serialized underorchestrator_opts.docker.SwarmOpts.Clone()to correctly copy both new fields.resolveInstanceImages()in the Swarm orchestrator to implement precedence-based image resolution:Image→ResolvedImage→ manifest lookup (lazy backfill).Imageis explicitly set, the manifest is bypassed entirely, allowing unknown or custom versions to work through user overrides.Testing
Verification:
Checklist
PLAT-596