nerdctl icon indicating copy to clipboard operation
nerdctl copied to clipboard

nerdctl inspect network does not show containers that are attached to multiple networks

Open apostasie opened this issue 7 months ago • 7 comments

Description

Presumably: https://github.com/containerd/nerdctl/pull/4052/files#diff-ab476be782991d582002aed7b680f12d1aa32a36beba47b0a6b1a035968cb8beR61 which seem to do a string comparison?

Steps to reproduce the issue

Run a container attached to multiple networks.

Describe the results you received and expected

Container should show in network inspect X, for all networks it is attached to.

What version of nerdctl are you using?

main

Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

Host information

No response

apostasie avatar May 22 '25 20:05 apostasie

I would like to fix this.

tushar5526 avatar Jun 06 '25 19:06 tushar5526

@tushar5526 sure, all yours :-)

apostasie avatar Jun 06 '25 19:06 apostasie

Found the issue, need to use regex to filter out instead of equality operator.

tushar5526 avatar Jun 06 '25 21:06 tushar5526

Found the issue, need to use regex to filter out instead of equality operator.

Could you please open a PR with the fix. Thanks

fahedouch avatar Jun 06 '25 21:06 fahedouch

Hi @tushar5526

While investigating another issue, I came across this problem, so I've created a PR https://github.com/containerd/nerdctl/pull/4309 for the fix. I apologize for missed this issue ... 🙇

haytok avatar Jun 07 '25 04:06 haytok

Hi @haytok, no problem. I left some comments on your PR based on another approach I found to be working.

tushar5526 avatar Jun 07 '25 08:06 tushar5526

I think we can close this one.

tushar5526 avatar Jun 22 '25 16:06 tushar5526