-
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
Add --force option to network rm subcommand #3547
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:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 cavcrosby#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! |
ec52be9
to
33cba73
Compare
Squashed your commit, and closed out the PR on cavcrosby#1. Should be good to go but let me know what you think. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]> Signed-off-by: Conner Crosby <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
33cba73
to
0ea587b
Compare
All green; let's get this one in Thanks! |
- What I did
Added a
-f
/--force
option to the network'srm
subcommand. 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 --force
command. This closes #2382.- How I did it
I was inspired by the volume
rm
subcommand's--force
option (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)