(ctx context.Context, dockerCli command.Cli, options searchOptions)
| 57 | } |
| 58 | |
| 59 | func 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]. |
no test coverage detected
searching dependent graphs…