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 (1)
📝 WalkthroughWalkthroughThis PR extends SwarmOpts with Image and ResolvedImage fields, updates Clone() to copy them, adds Orchestrator.resolveInstanceImages implementing precedence (Image → ResolvedImage → manifest fetch with lazy backfill and writes), refactors instanceResources to use it, and adds tests plus a version manifest JSON. 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 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.
|
Actionable comments posted: 0 |
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