MCPcopy Create free account
hub / github.com/containerd/nerdctl / psAction

Function psAction

cmd/nerdctl/container/container_list.go:126–144  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

124}
125
126func psAction(cmd *cobra.Command, args []string) error {
127 clOpts, fpOpts, err := processOptions(cmd)
128 if err != nil {
129 return err
130 }
131
132 client, ctx, cancel, err := clientutil.NewClient(cmd.Context(), clOpts.GOptions.Namespace, clOpts.GOptions.Address)
133 if err != nil {
134 return err
135 }
136 defer cancel()
137
138 containers, err := container.List(ctx, client, clOpts)
139 if err != nil {
140 return err
141 }
142
143 return formatAndPrintContainerInfo(containers, fpOpts)
144}
145
146// FormattingAndPrintingOptions specifies options for formatting and printing of `nerdctl (container) list`.
147type FormattingAndPrintingOptions struct {

Callers

nothing calls this directly

Calls 4

NewClientFunction · 0.92
ListFunction · 0.92
processOptionsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…