Conversation
…codecov/codecov-action-7.1.1
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The new exhaustive regression test omits standalone coverage for three cluster-specific flags.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1
Open (1)
What changed in this PR
Fixes cluster-volume option detection and corrects capacity help text.
Changes:
- Detects secret and topology flags as cluster options.
- Corrects minimum/maximum capacity descriptions.
- Adds per-flag regression tests.
| File | Description |
|---|---|
cli/command/volume/create.go |
Fixes cluster detection and help text. |
cli/command/volume/create_test.go |
Adds option-detection tests. |
docs/reference/commandline/volume_create.md |
Updates generated capacity documentation. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| Availability: volume.AvailabilityDrain, | ||
| }, | ||
| }, | ||
| } |
There was a problem hiding this comment.
Good catch, thanks. Added standalone cases for --scope, --sharing and --type and an AccessMode assertion, so each of the three is now exercised on its own. I checked that misspelling any of them in hasClusterVolumeOptionSet makes exactly that subtest fail. Squashed into the same commit.
cc669bb to
33452d8
Compare

Summary
hasClusterVolumeOptionSetdecides whether aClusterVolumeSpecis attached to the create request. It checked for a flag namedsecrets, but the flag is registered assecret, soflags.Changed("secrets")was always false. The--topology-requiredand--topology-preferredflags were not part of the check at all.Running
docker volume createwith only one of those options, for example:therefore created a plain, non-cluster volume and silently dropped the option.
This PR:
hasClusterVolumeOptionSetand adds the two topology flags to it--limit-bytes/--required-bytes, which were reversed:RequiredBytesis the minimum capacity andLimitBytesthe maximum, per thevolume.CapacityRangedocs. The generated markdown table is updated to matchTestVolumeCreateClusterOptionDetection, which sets each cluster-only flag on its own and checks that the resultingClusterVolumeSpeccarries it. The new test fails forsecret,topology-requiredandtopology-preferredon master and passes with this changeVerify with:
$ go test ./cli/command/volume/ -run TestVolumeCreate -vRelease notes (optional)