Skip to content
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

Fix: Delete the used network in other namespace #1636

Merged
merged 1 commit into from
Dec 10, 2022

Conversation

yzxiu
Copy link
Contributor

@yzxiu yzxiu commented Dec 9, 2022

fix #1635

nd: aliased to sudo nerdctl -n nerdctl-test
n: aliased to sudo nerdctl -n default

  1. create network test in namespace nerdctl-test
~ nd network create test --gateway 10.10.13.1 --subnet 10.10.13.0/24
9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
  1. create container use netwrok test in namespace nerdctl-test
~ nd run -d --network test --name ndtest nginx             
b2dee527f9954e93bfa49beda122ef3f641b7bf464c02340a80d1a02462b697a
  1. delete network test in namespace nerdctl-test , can't delete
~ nd network rm test                                                
ERRO[0000] network "test" is in use by container ["b2dee527f9954e93bfa49beda122ef3f641b7bf464c02340a80d1a02462b697a"]
  1. fix bug
~ n network rm test                                                 
ERRO[0000] network "test" is in use by container ["b2dee527f9954e93bfa49beda122ef3f641b7bf464c02340a80d1a02462b697a"]


In addition, do we need to output the namespace of the container? like

~ n network rm test                                                 
ERRO[0000] network "test" is in use by container ["b2dee527f9954e93bfa49beda122ef3f641b7bf464c02340a80d1a02462b697a[nerdctl-test]"]

because when the output container is not in the current namespace, it may be confusing



Signed-off-by: yaozhenxiu <946666800@qq.com>

@yzxiu yzxiu changed the title Fix: Delete the used network in other namespace Fix: Delete used network in other namespace Dec 9, 2022
@yzxiu yzxiu changed the title Fix: Delete used network in other namespace Fix: Delete the used network in other namespace Dec 9, 2022
@yzxiu
Copy link
Contributor Author

yzxiu commented Dec 9, 2022

@fahedouch @AkihiroSuda PTAL

@AkihiroSuda
Copy link
Member

Please squash commits and consider adding an integration test

Signed-off-by: yaozhenxiu <946666800@qq.com>
@yzxiu
Copy link
Contributor Author

yzxiu commented Dec 10, 2022

Please squash commits and consider adding an integration test

done

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda added this to the v1.1.0 milestone Dec 10, 2022
@AkihiroSuda AkihiroSuda merged commit 29d53af into containerd:main Dec 10, 2022
@yzxiu yzxiu deleted the fix-ls-used-network branch December 10, 2022 14:19
@yzxiu yzxiu restored the fix-ls-used-network branch December 10, 2022 14:20
@yzxiu yzxiu deleted the fix-ls-used-network branch December 10, 2022 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Delete the used network in other namespace
2 participants