Add --force option to network rm subcommand #3547
Add --force option to network rm subcommand #3547thaJeztah merged 1 commit intodocker:masterfrom cavcrosby:2382-add-force-flag
Conversation
Codecov Report
@@ Coverage Diff @@
## master #3547 +/- ##
==========================================
+ Coverage 57.33% 59.12% +1.79%
==========================================
Files 304 284 -20
Lines 26379 23823 -2556
==========================================
- Hits 15124 14086 -1038
+ Misses 10329 8881 -1448
+ Partials 926 856 -70 |
|
That's no bueno (or good, and in regards to the checks), err, can I get a maintainer's thoughts? At least in concerns to the automated checks performed:
|
thaJeztah
left a comment
There was a problem hiding this comment.
Thanks for working on this!
I left some suggestions inline, but was writing some of the changes while reviewing, so I'll open a pull request against your branch with those
|
I opened https://github.com/cavcrosby/docker-cli/pull/1 (which, once merged, should appear in this PR); perhaps you can also squash the commits (no need to preserve my commit as a separate commit); happy to help doing so if you want! |
|
Squashed your commit, and closed out the PR on cavcrosby#1. Should be good to go but let me know what you think. |
albers
left a comment
There was a problem hiding this comment.
Completion LGTM, thanks.
The code is similar to that used by the volume rm subcommand, however, one difference I noticed was VolumeRemove takes the force flag/option was a parameter. This isn't the case for NetworkRemove. To get NetworkRemove to take a similar parameter, this would require modifying the Docker daemon. For now this isn't a route I wish to take when the code can be arrange to mimic the same behavior. Co-authored-by: Sebastiaan van Stijn <github@gone.nl> Signed-off-by: Conner Crosby <conner@cavcrosby.tech>
thaJeztah
left a comment
There was a problem hiding this comment.
changes LGTM, thanks!
I think we can combine the 5 commits into one, as they're all related (and some of the later ones touch up previous ones); let me do a quick squash and push to the PR branch
|
All green; let's get this one in Thanks! |
- What I did
Added a
-f/--forceoption to the network'srmsubcommand. What this option allows is for a user to remove a configured Docker network but return a zero status code even if said network does not exist (stdout will also still display the network name). Similar to Unix'srm --forcecommand. This closes #2382.- How I did it
I was inspired by the volume
rmsubcommand's--forceoption (at least on the client-side) so hence my implementation is similar to it. However, like #2678, my changes only affect the client and are currently not implemented for the daemon.- How to verify it
docker network rm --force foo- Description for the changelog
Add --force option to network rm subcommand.
- A picture of a cute animal (not mandatory but encouraged)