fix: libvirt backend failures (#425, #427, #430, #431, #432)#484
fix: libvirt backend failures (#425, #427, #430, #431, #432)#484
Conversation
|
Warning Rate limit exceeded
To continue reviewing without waiting, purchase usage credits in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughVPC service initialization now accepts and stores the compute backend type. OVS bridge creation and NetworkID assignment are now conditional on the backend: Docker backends create bridges and populate NetworkID; libvirt backends skip bridge creation and leave NetworkID empty. Docker+OVS special-case logic is removed from network-resolution paths. Error logging is made backend-agnostic. ChangesVPC Networking Backend Abstraction
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsTimed out fetching pipeline failures after 30000ms 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 |
98bb0a0 to
685daeb
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@internal/core/services/vpc.go`:
- Around line 114-117: CreateVPC currently calls s.network.CreateBridge in the
non-libvirt branch without checking s.network, which can cause a nil-pointer
panic; update CreateVPC to guard s.network before using it: if s.network is nil
return an appropriate domain/internal error (wrap with errors.Wrap like other
failures) instead of calling s.network.CreateBridge, and only call
s.network.CreateBridge(ctx, bridgeName, vxlanID) when s.network != nil; ensure
the error message references the bridge creation step so callers can diagnose
the missing network implementation.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3f294833-a1c4-4392-a9e7-e7757946730b
📒 Files selected for processing (6)
internal/api/setup/dependencies.gointernal/core/services/cache.gointernal/core/services/database.gointernal/core/services/instance.gointernal/core/services/vpc.gointernal/platform/resilient_compute.go
💤 Files with no reviewable changes (2)
- internal/core/services/cache.go
- internal/core/services/database.go
- Remove hardcoded compute.Type()=="docker" checks in cache.go and
database.go that broke libvirt backend. These OVS bridge checks
were Docker-specific and never triggered for libvirt anyway.
- Make instance stop error messages backend-agnostic in instance.go.
Error now says "failed to stop {backend} instance" instead of
hardcoded "failed to stop container".
- Add ComputeBackend field to VpcServiceParams. When libvirt is the
compute backend, VPC creation skips OVS bridge creation since
libvirt manages its own networking.
- Document in ResilientCompute godoc that the circuit breaker is
per-backend (not per-operation), explaining the design trade-off.
Fixes: #425, #427, #430, #431, #432
685daeb to
c112970
Compare
Summary
compute.Type() == "docker"checks from cache and database services that broke libvirt backendCOMPUTE_BACKEND=libvirt(libvirt manages its own networking)ResilientComputecircuit breaker is per-backend, not per-operationTest plan
go build ./...passesgo test ./internal/core/services/...passes (VPC, cache, database, instance tests)Fixes #425, #427, #430, #431, #432