Skip to content

feat: add --format flag to namespace ls command #4446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SpiffyEight77
Copy link
Contributor

@SpiffyEight77 SpiffyEight77 commented Aug 5, 2025

Description

related Issue #3851

Adds --format flag support to nerdctl namespace ls command for custom output formatting.

Test

nerdctl namespace ls

nerdctl namespace ls
NAME       CONTAINERS    IMAGES    VOLUMES    LABELS
default    0             2         0          env=staging,region=us-west,team=frontend
moby       0             0         0

nerdctl namespace ls -q

nerdctl namespace ls -q
default
moby

nerdctl namespace ls -f '{{json .}}'

nerdctl namespace ls -f '{{json .}}'
{"Name":"default","Containers":0,"Images":2,"Volumes":0,"Labels":{"env":"staging","region":"us-west","team":"frontend"}}
{"Name":"moby","Containers":0,"Images":0,"Volumes":0,"Labels":null}

nerdctl namespace ls -f '{{json .}}' -q

nerdctl namespace ls -f '{{json .}}' -q
FATA[0000] format and quiet must not be specified together

@SpiffyEight77 SpiffyEight77 force-pushed the feat/namespace-ls-format-flag branch from ef14f6b to 3044e84 Compare August 5, 2025 09:06
@SpiffyEight77 SpiffyEight77 marked this pull request as draft August 5, 2025 09:08
@SpiffyEight77 SpiffyEight77 force-pushed the feat/namespace-ls-format-flag branch 2 times, most recently from f97d2ff to 483939a Compare August 5, 2025 09:16
@SpiffyEight77 SpiffyEight77 marked this pull request as ready for review August 5, 2025 09:18
@SpiffyEight77 SpiffyEight77 force-pushed the feat/namespace-ls-format-flag branch from 483939a to c56c49d Compare August 5, 2025 15:18
@AkihiroSuda AkihiroSuda added this to the v2.1.4 milestone Aug 6, 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