You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: display containers belonging to multiple networks in nerdctl network inspect
When a container belongs to multiple networks, running the nerdctl network
inspect command on the network to which the container belongs does not
display the container in the current implementation.
Specifically, it is displayed as follows.
```
$ sudo nerdctl run -d --name net --net=foo --net=bar nginx
d88e878f0c60823bd0c361bad250f27b19ad117fb3336fcf18fa26ab1910c367
$ sudo nerdctl network inspect foo | jq .[0].Containers
{}
$ sudo nerdctl network inspect bar | jq .[0].Containers
{}
```
Ideally, running the nerdctl network inspect command on the networks to
which the contaienr belongs should display the container name as follows.
```
$ sudo nerdctl network inspect foo | jq .[0].Containers
{
"d88e878f0c60823bd0c361bad250f27b19ad117fb3336fcf18fa26ab1910c367": {
"Name": "net"
}
}
$ sudo nerdctl network inspect bar | jq .[0].Containers
{
"d88e878f0c60823bd0c361bad250f27b19ad117fb3336fcf18fa26ab1910c367": {
"Name": "net"
}
}
```
Therefore, this behaviour is fixed in this PR.
Signed-off-by: Hayato Kiwata <[email protected]>
0 commit comments