MCPcopy Create free account
hub / github.com/docker/cli / newSecretListCommand

Function newSecretListCommand

cli/command/secret/ls.go:23–44  ·  view source on GitHub ↗
(dockerCLI command.Cli)

Source from the content-addressed store, hash-verified

21}
22
23func newSecretListCommand(dockerCLI command.Cli) *cobra.Command {
24 options := listOptions{filter: opts.NewFilterOpt()}
25
26 cmd := &cobra.Command{
27 Use: "ls [OPTIONS]",
28 Aliases: []string{"list"},
29 Short: "List secrets",
30 Args: cli.NoArgs,
31 RunE: func(cmd *cobra.Command, args []string) error {
32 return runSecretList(cmd.Context(), dockerCLI, options)
33 },
34 ValidArgsFunction: cobra.NoFileCompletions,
35 DisableFlagsInUseLine: true,
36 }
37
38 flags := cmd.Flags()
39 flags.BoolVarP(&options.quiet, "quiet", "q", false, "Only display IDs")
40 flags.StringVar(&options.format, "format", "", flagsHelper.FormatHelp)
41 flags.VarP(&options.filter, "filter", "f", "Filter output based on conditions provided")
42
43 return cmd
44}
45
46func runSecretList(ctx context.Context, dockerCLI command.Cli, options listOptions) error {
47 apiClient := dockerCLI.Client()

Callers 7

newSecretCommandFunction · 0.85
TestSecretListErrorsFunction · 0.85
TestSecretListFunction · 0.85
TestSecretListWithFormatFunction · 0.85
TestSecretListWithFilterFunction · 0.85

Calls 1

runSecretListFunction · 0.85

Tested by 6

TestSecretListErrorsFunction · 0.68
TestSecretListFunction · 0.68
TestSecretListWithFormatFunction · 0.68
TestSecretListWithFilterFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…