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

Function runSearch

cli/command/registry/search.go:59–84  ·  view source on GitHub ↗
(ctx context.Context, dockerCli command.Cli, options searchOptions)

Source from the content-addressed store, hash-verified

57}
58
59func runSearch(ctx context.Context, dockerCli command.Cli, options searchOptions) error {
60 if _, ok := options.filter.Value()["is-automated"]; ok {
61 _, _ = fmt.Fprintln(dockerCli.Err(), `WARNING: the "is-automated" filter is deprecated, and searching for "is-automated=true" will not yield any results in future.`)
62 }
63 encodedAuth, err := getAuth(dockerCli, options.term)
64 if err != nil {
65 return err
66 }
67
68 results, err := dockerCli.Client().ImageSearch(ctx, options.term, client.ImageSearchOptions{
69 RegistryAuth: encodedAuth,
70 PrivilegeFunc: nil,
71 Filters: options.filter.Value(),
72 Limit: options.limit,
73 })
74 if err != nil {
75 return err
76 }
77
78 searchCtx := formatter.Context{
79 Output: dockerCli.Out(),
80 Format: newFormat(options.format),
81 Trunc: !options.noTrunc,
82 }
83 return formatWrite(searchCtx, results)
84}
85
86// authConfigKey is the key used to store credentials for Docker Hub. It is
87// a copy of [registry.IndexServer].

Callers 1

newSearchCommandFunction · 0.85

Calls 7

getAuthFunction · 0.85
newFormatFunction · 0.70
formatWriteFunction · 0.70
ValueMethod · 0.65
ErrMethod · 0.65
ClientMethod · 0.65
OutMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…