Skip to content

[FIX]: ensure cleanup of cni config in case of failure in createRuntime - #4254

Closed
apostasie wants to merge 1 commit into
containerd:mainfrom
apostasie:2025-05-oh-cni
Closed

apostasie wants to merge 1 commit into
containerd:mainfrom
apostasie:2025-05-oh-cni

Conversation

@apostasie

@apostasie apostasie commented May 15, 2025 •

Copy link
Copy Markdown
Contributor

This is a fix for #4253, possibly for #4246 - likely for others as well:

Maybe indirectly responsible for #3487 and possibly some of #3253

Possibly as well:

@apostasie apostasie changed the title Cleanup cni config in case of failure [FIX]: ensure cleanup of cni config in case of failure in createRuntime May 15, 2025
@apostasie

Copy link
Copy Markdown
Contributor Author

We need to review all of this lifecycle - and I would put that in the same bucket as "rewrite CNIenv".

What should happen if I restart such a container after deleting the one that was port conflicting?
Right now I am getting mkdir /run/containerd/io.containerd.runtime.v2.task/default/ebc4ab0968ba6d8ae8455bae8b11298b50573a2213d099d233d84b6a07bfe31c: file exists

We are fine with the "happy path", but as soon as things go south, we just break the system with no recovery hope but trash it all.

@fahedouch

Copy link
Copy Markdown
Member

Hi @apostasie,
I think it is more relevant to clean the netns on task.Kill(), there is no point to keep iptables rules after container kill

@apostasie

Copy link
Copy Markdown
Contributor Author

Hi @apostasie, I think it is more relevant to clean the netns on task.Kill(), there is no point to keep iptables rules after container kill

Would that cover the scenario described here though? (eg: failing during onCreateRuntime with a run -d)

@apostasie

Copy link
Copy Markdown
Contributor Author

Closing after discussion with @fahedouch who will incorporate commit into #4255.

@apostasie apostasie closed this May 17, 2025
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