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

Function runSecretList

cli/command/secret/ls.go:46–71  ·  view source on GitHub ↗
(ctx context.Context, dockerCLI command.Cli, options listOptions)

Source from the content-addressed store, hash-verified

44}
45
46func runSecretList(ctx context.Context, dockerCLI command.Cli, options listOptions) error {
47 apiClient := dockerCLI.Client()
48
49 res, err := apiClient.SecretList(ctx, client.SecretListOptions{Filters: options.filter.Value()})
50 if err != nil {
51 return err
52 }
53 format := options.format
54 if len(format) == 0 {
55 if len(dockerCLI.ConfigFile().SecretFormat) > 0 && !options.quiet {
56 format = dockerCLI.ConfigFile().SecretFormat
57 } else {
58 format = formatter.TableFormatKey
59 }
60 }
61
62 sort.Slice(res.Items, func(i, j int) bool {
63 return sortorder.NaturalLess(res.Items[i].Spec.Name, res.Items[j].Spec.Name)
64 })
65
66 secretCtx := formatter.Context{
67 Output: dockerCLI.Out(),
68 Format: newFormat(format, options.quiet),
69 }
70 return formatWrite(secretCtx, res)
71}

Callers 1

newSecretListCommandFunction · 0.85

Calls 7

newFormatFunction · 0.70
formatWriteFunction · 0.70
ClientMethod · 0.65
ValueMethod · 0.65
ConfigFileMethod · 0.65
OutMethod · 0.65
SecretListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…