Skip to content

improvements in namespace inspect command#4864

Open
Exar04 wants to merge 4 commits intocontainerd:mainfrom
Exar04:namespace-inspect-issues
Open

improvements in namespace inspect command#4864
Exar04 wants to merge 4 commits intocontainerd:mainfrom
Exar04:namespace-inspect-issues

Conversation

@Exar04
Copy link
Copy Markdown

@Exar04 Exar04 commented Apr 23, 2026

reference : #3851

this pr adds information of containers in the given namespace

… in that namespace

Signed-off-by: Exar04 <yashdhadwe@gmail.com>
@Exar04
Copy link
Copy Markdown
Author

Exar04 commented Apr 23, 2026

Should I add all the data of containers? like right now its just exposing id, name, and image

Signed-off-by: Exar04 <yashdhadwe@gmail.com>
@Exar04
Copy link
Copy Markdown
Author

Exar04 commented Apr 23, 2026

I’m having trouble understanding the failed tests. Could someone please help explain them?

@haytok
Copy link
Copy Markdown
Member

haytok commented Apr 24, 2026

Hi, @Exar04
Thanks for the PR! Could you please add tests for this change before we move forward?

@AkihiroSuda
Copy link
Copy Markdown
Member

Why not just use nerdctl container ls

this test checks if the command is giving valid json output

Signed-off-by: Exar04 <yashdhadwe@gmail.com>
@Exar04
Copy link
Copy Markdown
Author

Exar04 commented Apr 24, 2026

@AkihiroSuda this pr adds additional metadata for a given namespace

The issue stated

namespace inspect should at least have the same information available on namespace list

which is namespace name, images, volumes, containers and labels

$ nerdctl ns list
NAME               CONTAINERS    IMAGES    VOLUMES    LABELS
default            2             4         0              
default_history    0             0         0         

Previously, the command only returned the namespace name and labels ->

$ nerdctl ns inspect default
[
    {
        "Name": "default",
        "Labels": null
    }
]

Now this PR adds container data as well ->

$ nerdctl ns inspect default
[
    {
        "Name": "default",
        "Labels": null,
        "Containers": [
            {
                "id": "1d92cb93e730746035be84ff8d32faa60240d85ecf8c38f99ae50c6aaa246b7e",
                "image": "docker.io/library/hello-world:latest",
                "name": "io.containerd.runc.v2"
            },
            {
                "id": "7c43b7c3c735755d97353b9afe85d47690cb7511eceac63d0e123ac3060309f1",
                "image": "docker.io/library/nginx:latest",
                "name": "io.containerd.runc.v2"
            }
        ]
    }
]

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.

3 participants