feat: wire image field through API for custom image pinning per database or node#401
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 ignored due to path filters (11)
📒 Files selected for processing (9)
📝 WalkthroughWalkthroughThis PR introduces image override capability for Docker Swarm orchestrator options, allowing users to specify custom container images. Image overrides are validated against version manifests; warnings are collected throughout the validation pipeline and returned in API responses alongside successful database creation/update results. ChangesImage Override with Validation Warnings
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
|
| Metric | Results |
|---|---|
| Complexity | 9 |
| Duplication | 2 |
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.
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
This PR wires the
imagefield through the API, allowing users to pin any container image at either the database or node level viaorchestrator_opts.swarm.image. The Control Plane deploys the specified image without requiring manifest validation, while returning a warning in the API response when the image is not present in the manifest.Changes
imagefield to theSwarmOptsGoa type and regenerated the API layer.Warnings []stringtoValidationResultandValidateSpecOutput, allowing non-fatal validation warnings to be propagated through the validation workflow and returned to API callers.ValidateInstanceSpecsto emit a warning whenSwarmOpts.Imageis explicitly set and differs from the manifest-resolved image for the selected version. The specification remains valid and is still accepted.overridableValue()merge logic inNodeInstances(), requiring no additional changes.Imageis cleared, the Control Plane automatically falls back toResolvedImageduring the next reconcile cycle using the existingresolveInstanceImages()precedence logic.Testing
Verification:
Custom image at database level → warning returned, image deployed, Docker surfaces pull failure for non-existent image
docker service ls | grep storefront
2lyuimxnkbc2 postgres-storefront-manifest-image-n1-9ptayhma replicated 1/1 ghcr.io/pgedge/pgedge-postgres:17.9-spock5.0.6-standard-2
9792vnbo0jwn postgres-storefront-manifest-image-n1-689qacsi replicated 1/1 ghcr.io/pgedge/pgedge-postgres:17.9-spock5.0.6-standard-2
8a3zmtz2hbzq postgres-storefront-manifest-image-n1-ant97dj4 replicated 1/1 ghcr.io/pgedge/pgedge-postgres:17.9-spock5.0.6-standard-2
Checklist
PLAT-599