-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[27.x backport] volume/update: require 1 argument/fix panic #5426
[27.x backport] volume/update: require 1 argument/fix panic #5426
Conversation
This command was declaring that it requires at least 1 argument, when it needs exactly 1 argument. This was causing the CLI to panic when the command was invoked with no argument: `docker volume update` Signed-off-by: Laura Brehm <laurabrehm@hey.com> (cherry picked from commit daea277) Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 27.x #5426 +/- ##
==========================================
+ Coverage 59.77% 59.81% +0.04%
==========================================
Files 345 345
Lines 23405 23396 -9
==========================================
+ Hits 13990 13994 +4
+ Misses 8445 8432 -13
Partials 970 970 |
|
Ah! Failing because the 27.x branch doesn't have some of the UX improvements we made; |
The error-message changed in newer versions, and no longer includes
"exactly".
This patch adjusts the test in the meantime.
59.13 === FAIL: cli/command/volume TestUpdateCmd (0.00s)
59.13 update_test.go:21: assertion failed: expected error to contain "requires 1 argument", got "\"update\" requires exactly 1 argument.\nSee 'update --help'.\n\nUsage: update [OPTIONS] [VOLUME] [flags]\n\nUpdate a volume (cluster volumes only)"
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
|
I pushed a commit to adjust the test for now. We can revert that commit it we decide to backport the improvements. |
|
Sounds good to me, thanks for taking care of this! |


- What I did
This command was declaring that it requires at least 1 argument, when it needs exactly 1 argument. This was causing the CLI to panic when the command was invoked with no argument.
- How I did it
Require exactly 1 argument.
- How to verify it
docker volume update- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)