feat(replica): configurable volume replica count via lb_replica_count#11
Merged
Conversation
Add an optional lb_replica_count storage property (integer, 1-3) used as the replicaCount when creating volumes in alloc_image; defaults to 1, so existing storages are unchanged. The requested count must be supported by the cluster (a single-node cluster only accepts 1, which the cluster rejects clearly otherwise). Add t/replica_count.t (default + explicit values in the create body). Update README (drop the now-stale single-replica limitation, document the option, trim the roadmap item) and CHANGELOG.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR makes Lightbits volume replica count configurable via a new ChangesConfigurable Lightbits volume replica count
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Per security review: int() the replica count so a value read back from storage.cfg (a string) serialises as a JSON number, matching the previous hardcoded literal rather than "2". Add default => 1 to the property schema so PVE surfaces it in generated docs/UI. Extend the test with a string-input case asserting numeric JSON encoding.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an optional
lb_replica_countstorage property so volumes can be created with more than one replica, instead of the hardcodedreplicaCount: 1.optional).alloc_imageuses$scfg->{lb_replica_count} // 1— defaults to 1, so existing storages are unchanged.Testing
t/replica_count.t): default →replicaCount 1; explicit 1/2/3 flow through to the create body. Full suite: 95 tests pass.lb_replica_count=1→ volume created withreplicaCount=1(verified on the cluster).lb_replica_count=3→ alloc fails cleanly:400 ... "In single server cluster, replica count must be 1"— confirms the option flows PVE → plugin → API.Docs
--lb_replica_count, trimmed the roadmap item. CHANGELOG updated.Notes
main(independent of other feature groups). Group B in the feature split.Summary by CodeRabbit
New Features
Documentation
Tests