Skip to content

fix(namespace): remove all requested namespaces - #5365

Merged
AkihiroSuda merged 1 commit into
containerd:mainfrom
immanuwell:fix/namespace-remove-multiple
Nov 25, 2026
Merged

AkihiroSuda merged 1 commit into
containerd:mainfrom
immanuwell:fix/namespace-remove-multiple

Conversation

@immanuwell

Copy link
Copy Markdown
Contributor

namespace rm a b returns success after removing only a, leaving b behind. Return only on a write error so the loop handles every name.

Repro with containerd running:

sudo nerdctl namespace create ns-rm-repro-a
sudo nerdctl namespace create ns-rm-repro-b
sudo nerdctl namespace rm ns-rm-repro-a ns-rm-repro-b
sudo nerdctl namespace ls -q

Before: ns-rm-repro-b is still listed. After: both are gone.

Verified against containerd 2.2.5. Regression tests, unit tests (isolated network namespace), and Linux lint pass.

Only return from the removal loop when writing the namespace name fails.
The unconditional return skipped the remaining names and reported success.

Signed-off-by: Immanuel Tikhonov <pchpr.00@list.ru>
@AkihiroSuda AkihiroSuda added this to the v2.5.0 milestone Nov 25, 2026

@AkihiroSuda AkihiroSuda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks

@AkihiroSuda
AkihiroSuda merged commit 9914701 into containerd:main Nov 25, 2026
56 of 60 checks passed
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.

2 participants