Check LXD version before using it as a backend#473
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds LXD version compatibility checking to ensure the workshop daemon only works with LXD versions 6.3 and above. The change prevents the daemon from starting with incompatible LXD versions and provides clear error messages to users.
Key changes:
- Implements version checking logic that validates LXD server version against minimum requirements (6.3+)
- Adds comprehensive test coverage for version validation edge cases
- Integrates version checking into the LXD backend initialization process
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
internal/workshop/lxd/lxd_backend.go |
Adds version checking functions and integrates them into backend initialization |
internal/workshop/lxd/lxd_backend_test.go |
Comprehensive test cases for version validation logic |
internal/workshop/lxd/export_test.go |
Exports the version checking function for testing |
internal/workshop/backend.go |
Adds new error type for incompatible backend scenarios |
tests/main/compatible-backend/ |
Integration test files to verify LXD compatibility checking |
internal/overlord/overlord.go |
Minor code cleanup removing redundant error check |
internal/daemon/daemon.go |
Refactors error handling to use switch statement for better readability |
88fc317 to
611d495
Compare
jonathan-conder
left a comment
There was a problem hiding this comment.
Couple of minor things, the main thing is I don't think it's safe to refresh to an older version of LXD
6455647 to
f423919
Compare
TICS Quality Gate✔️ PassedworkshopAll conditions passedSee the results in the TICS Viewer The following files have been checked for this project
|
33e9a74 to
2649842
Compare
2649842 to
6904f5e
Compare
jonathan-conder
left a comment
There was a problem hiding this comment.
Yeah I think this makes sense. My main concern is that being in degraded mode doesn't seem to block GET requests, or prevent the backend from being initialised. I think it works for the purpose of improving error messages for new users, at least.
|
@jonathan-conder the only command which does not start with POST and uses the backed is |
6904f5e to
899c46a
Compare
Description
Check LXD version before using it as a backend.
Self-review quick check
Docs
Or: