Skip to content

Commit 4fc3f0e

Browse files
committed
search: deprecate "is-automated" filter and "IsAutomated" field
The IsAutomated field is being deprecated by Docker Hub's search API and will always be "false" in future. This patch: - Deprecates the field and the related "is-automated" filter - Removes the "AUTOMATED" column from the default output of "docker search" Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent 53671c2 commit 4fc3f0e

File tree

8 files changed

+84
-89
lines changed

8 files changed

+84
-89
lines changed

‎cli/command/registry/formatter_search.go‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
)
1010

1111
const (
12-
defaultSearchTableFormat = "table {{.Name}}\t{{.Description}}\t{{.StarCount}}\t{{.IsOfficial}}\t{{.IsAutomated}}"
12+
defaultSearchTableFormat = "table {{.Name}}\t{{.Description}}\t{{.StarCount}}\t{{.IsOfficial}}"
1313

1414
starsHeader = "STARS"
1515
officialHeader = "OFFICIAL"
@@ -19,9 +19,7 @@ const (
1919
// NewSearchFormat returns a Format for rendering using a network Context
2020
func NewSearchFormat(source string) formatter.Format {
2121
switch source {
22-
case "":
23-
return defaultSearchTableFormat
24-
case formatter.TableFormatKey:
22+
case "", formatter.TableFormatKey:
2523
return defaultSearchTableFormat
2624
}
2725
return formatter.Format(source)
@@ -95,6 +93,9 @@ func (c *searchContext) IsOfficial() string {
9593
return c.formatBool(c.s.IsOfficial)
9694
}
9795

96+
// IsAutomated formats the IsAutomated field for printing.
97+
//
98+
// Deprecated: the "is_automated" field is deprecated and will always be "false" in the future.
9899
func (c *searchContext) IsAutomated() string {
99100
return c.formatBool(c.s.IsAutomated) //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
100101
}

‎cli/command/registry/formatter_search_test.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ func TestSearchContext(t *testing.T) {
5050
s: registrytypes.SearchResult{IsAutomated: true}, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
5151
},
5252
expValue: "[OK]",
53-
call: ctx.IsAutomated,
53+
call: ctx.IsAutomated, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
5454
},
5555
{
5656
searchCtx: searchContext{
5757
s: registrytypes.SearchResult{},
5858
},
59-
call: ctx.IsAutomated,
59+
call: ctx.IsAutomated, //nolint:staticcheck // ignore SA1019 (IsAutomated is deprecated).
6060
},
6161
}
6262

‎cli/command/registry/search.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package registry
22

33
import (
44
"context"
5+
"fmt"
56

67
"github.com/docker/cli/cli"
78
"github.com/docker/cli/cli/command"
@@ -49,6 +50,9 @@ func NewSearchCommand(dockerCli command.Cli) *cobra.Command {
4950
}
5051

5152
func runSearch(dockerCli command.Cli, options searchOptions) error {
53+
if options.filter.Value().Contains("is-automated") {
54+
_, _ = fmt.Fprintln(dockerCli.Err(), `WARNING: the "is-automated" filter is deprecated, and searching for "is-automated=true" will not yield any results in future.`)
55+
}
5256
indexInfo, err := registry.ParseSearchIndexInfo(options.term)
5357
if err != nil {
5458
return err
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
2-
result1 Official build 5000 [OK]
1+
NAME DESCRIPTION STARS OFFICIAL
2+
result1 Official build 5000 [OK]
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
2-
result1 Official build 5000 [OK]
3-
result2 Not official 5 [OK]
1+
NAME DESCRIPTION STARS OFFICIAL
2+
result1 Official build 5000 [OK]
3+
result2 Not official 5

‎docs/deprecated.md‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ The table below provides an overview of the current status of deprecated feature
5050

5151
| Status | Feature | Deprecated | Remove |
5252
|------------|------------------------------------------------------------------------------------------------------------------------------------|------------|--------|
53+
| Deprecated | [IsAutomated field, and "is-automated" filter on docker search](#isautomated-field--and-is--automated-filter-on-docker-search) | v25.0 | - |
5354
| Deprecated | [OOM-score adjust for the daemon](#oom-score-adjust-for-the-daemon) | v24.0 | v25.0 |
5455
| Removed | [Buildkit build information](#buildkit-build-information) | v23.0 | v24.0 |
5556
| Deprecated | [Legacy builder for Linux images](#legacy-builder-for-linux-images) | v23.0 | - |
@@ -106,6 +107,21 @@ The table below provides an overview of the current status of deprecated feature
106107
| Removed | [`--run` flag on `docker commit`](#--run-flag-on-docker-commit) | v0.10 | v1.13 |
107108
| Removed | [Three arguments form in `docker import`](#three-arguments-form-in-docker-import) | v0.6.7 | v1.12 |
108109

110+
111+
### IsAutomated field, and "is-automated" filter on docker search
112+
113+
**Deprecated in Release: v25.0**
114+
**Target For Removal In Release: v26.0**
115+
116+
The "is_automated" field has been deprecated by Docker Hub's search API.
117+
Consequently, the `IsAutomated` field in image search will always be set
118+
to `false` in future, and searching for "is-automated=true" will yield no
119+
results.
120+
121+
The `AUTOMATED` column has been removed from the default `docker search`
122+
and `docker image search` output in v25.0, and the corresponding `IsAutomated`
123+
templating option will be removed in v26.0.
124+
109125
### OOM-score adjust for the daemon
110126

111127
**Deprecated in Release: v24.0**

‎docs/reference/commandline/search.md‎

Lines changed: 49 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -28,31 +28,31 @@ This example displays images with a name containing 'busybox':
2828
```console
2929
$ docker search busybox
3030

31-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
31+
NAME DESCRIPTION STARS OFFICIAL
3232
busybox Busybox base image. 316 [OK]
33-
progrium/busybox 50 [OK]
34-
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK]
35-
odise/busybox-python 2 [OK]
36-
azukiapp/busybox This image is meant to be used as the base... 2 [OK]
37-
ofayau/busybox-jvm Prepare busybox to install a 32 bits JVM. 1 [OK]
38-
shingonoide/archlinux-busybox Arch Linux, a lightweight and flexible Lin... 1 [OK]
39-
odise/busybox-curl 1 [OK]
40-
ofayau/busybox-libc32 Busybox with 32 bits (and 64 bits) libs 1 [OK]
41-
peelsky/zulu-openjdk-busybox 1 [OK]
42-
skomma/busybox-data Docker image suitable for data volume cont... 1 [OK]
43-
elektritter/busybox-teamspeak Lightweight teamspeak3 container based on... 1 [OK]
44-
socketplane/busybox 1 [OK]
45-
oveits/docker-nginx-busybox This is a tiny NginX docker image based on... 0 [OK]
46-
ggtools/busybox-ubuntu Busybox ubuntu version with extra goodies 0 [OK]
47-
nikfoundas/busybox-confd Minimal busybox based distribution of confd 0 [OK]
48-
openshift/busybox-http-app 0 [OK]
49-
jllopis/busybox 0 [OK]
50-
swyckoff/busybox 0 [OK]
51-
powellquiring/busybox 0 [OK]
52-
williamyeh/busybox-sh Docker image for BusyBox's sh 0 [OK]
53-
simplexsys/busybox-cli-powered Docker busybox images, with a few often us... 0 [OK]
54-
fhisamoto/busybox-java Busybox java 0 [OK]
55-
scottabernethy/busybox 0 [OK]
33+
progrium/busybox 50
34+
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8
35+
odise/busybox-python 2
36+
azukiapp/busybox This image is meant to be used as the base... 2
37+
ofayau/busybox-jvm Prepare busybox to install a 32 bits JVM. 1
38+
shingonoide/archlinux-busybox Arch Linux, a lightweight and flexible Lin... 1
39+
odise/busybox-curl 1
40+
ofayau/busybox-libc32 Busybox with 32 bits (and 64 bits) libs 1
41+
peelsky/zulu-openjdk-busybox 1
42+
skomma/busybox-data Docker image suitable for data volume cont... 1
43+
elektritter/busybox-teamspeak Lightweight teamspeak3 container based on... 1
44+
socketplane/busybox 1
45+
oveits/docker-nginx-busybox This is a tiny NginX docker image based on... 0
46+
ggtools/busybox-ubuntu Busybox ubuntu version with extra goodies 0
47+
nikfoundas/busybox-confd Minimal busybox based distribution of confd 0
48+
openshift/busybox-http-app 0
49+
jllopis/busybox 0
50+
swyckoff/busybox 0
51+
powellquiring/busybox 0
52+
williamyeh/busybox-sh Docker image for BusyBox's sh 0
53+
simplexsys/busybox-cli-powered Docker busybox images, with a few often us... 0
54+
fhisamoto/busybox-java Busybox java 0
55+
scottabernethy/busybox 0
5656
marclop/busybox-solr
5757
```
5858

@@ -64,10 +64,10 @@ at least 3 stars and the description isn't truncated in the output:
6464
```console
6565
$ docker search --filter=stars=3 --no-trunc busybox
6666

67-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
67+
NAME DESCRIPTION STARS OFFICIAL
6868
busybox Busybox base image. 325 [OK]
69-
progrium/busybox 50 [OK]
70-
radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8 [OK]
69+
progrium/busybox 50
70+
radial/busyboxplus Full-chain, Internet enabled, busybox made from scratch. Comes in git and cURL flavors. 8
7171
```
7272

7373
### <a name="limit"></a> Limit search results (--limit)
@@ -78,12 +78,12 @@ value is set, the default is set by the daemon.
7878
### <a name="filter"></a> Filtering (--filter)
7979

8080
The filtering flag (`-f` or `--filter`) format is a `key=value` pair. If there is more
81-
than one filter, then pass multiple flags (e.g. `--filter is-automated=true --filter stars=3`)
81+
than one filter, then pass multiple flags (e.g. `--filter is-official=true --filter stars=3`)
8282

8383
The currently supported filters are:
8484

8585
- stars (int - number of stars the image has)
86-
- is-automated (boolean - true or false) - is the image automated or not
86+
- is-automated (boolean - true or false) - is the image automated or not (deprecated)
8787
- is-official (boolean - true or false) - is the image official or not
8888

8989
#### stars
@@ -94,23 +94,10 @@ least 3 stars:
9494
```console
9595
$ docker search --filter stars=3 busybox
9696

97-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
97+
NAME DESCRIPTION STARS OFFICIAL
9898
busybox Busybox base image. 325 [OK]
99-
progrium/busybox 50 [OK]
100-
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK]
101-
```
102-
103-
#### is-automated
104-
105-
This example displays images with a name containing 'busybox'
106-
and are automated builds:
107-
108-
```console
109-
$ docker search --filter is-automated=true busybox
110-
111-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
112-
progrium/busybox 50 [OK]
113-
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8 [OK]
99+
progrium/busybox 50
100+
radial/busyboxplus Full-chain, Internet enabled, busybox made... 8
114101
```
115102

116103
#### is-official
@@ -121,7 +108,7 @@ This example displays images with a name containing 'busybox', at least
121108
```console
122109
$ docker search --filter is-official=true --filter stars=3 busybox
123110

124-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
111+
NAME DESCRIPTION STARS OFFICIAL
125112
busybox Busybox base image. 325 [OK]
126113
```
127114

@@ -132,13 +119,13 @@ using a Go template.
132119

133120
Valid placeholders for the Go template are:
134121

135-
| Placeholder | Description |
136-
|----------------|-----------------------------------|
137-
| `.Name` | Image Name |
138-
| `.Description` | Image description |
139-
| `.StarCount` | Number of stars for the image |
140-
| `.IsOfficial` | "OK" if image is official |
141-
| `.IsAutomated` | "OK" if image build was automated |
122+
| Placeholder | Description |
123+
|----------------|------------------------------------------------|
124+
| `.Name` | Image Name |
125+
| `.Description` | Image description |
126+
| `.StarCount` | Number of stars for the image |
127+
| `.IsOfficial` | "OK" if image is official |
128+
| `.IsAutomated` | "OK" if image build was automated (deprecated) |
142129

143130
When you use the `--format` option, the `search` command will
144131
output the data exactly as the template declares. If you use the
@@ -165,13 +152,13 @@ maxexcloo/nginx: 7
165152
This example outputs a table format:
166153

167154
```console
168-
$ docker search --format "table {{.Name}}\t{{.IsAutomated}}\t{{.IsOfficial}}" nginx
169-
170-
NAME AUTOMATED OFFICIAL
171-
nginx [OK]
172-
jwilder/nginx-proxy [OK]
173-
richarvey/nginx-php-fpm [OK]
174-
jrcs/letsencrypt-nginx-proxy-companion [OK]
175-
million12/nginx-php [OK]
176-
webdevops/php-nginx [OK]
155+
$ docker search --format "table {{.Name}}\t{{.IsOfficial}}" nginx
156+
157+
NAME OFFICIAL
158+
nginx [OK]
159+
jwilder/nginx-proxy
160+
richarvey/nginx-php-fpm
161+
jrcs/letsencrypt-nginx-proxy-companion
162+
million12/nginx-php
163+
webdevops/php-nginx
177164
```

‎man/src/search.md‎

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ of stars awarded, whether the image is official, and whether it is automated.
66

77
Filter output based on these conditions:
88
- stars=<numberOfStar>
9-
- is-automated=(true|false)
9+
- is-automated=(true|false) (deprecated)
1010
- is-official=(true|false)
1111

1212
# EXAMPLES
@@ -17,18 +17,5 @@ Search a registry for the term 'fedora' and only display those images
1717
ranked 3 or higher:
1818

1919
$ docker search --filter=stars=3 fedora
20-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
21-
mattdm/fedora A basic Fedora image corresponding roughly... 50
22-
fedora (Semi) Official Fedora base image. 38
23-
mattdm/fedora-small A small Fedora image on which to build. Co... 8
24-
goldmann/wildfly A WildFly application server running on a ... 3 [OK]
25-
26-
## Search Docker Hub for automated images
27-
28-
Search Docker Hub for the term 'fedora' and only display automated images
29-
ranked 1 or higher:
30-
31-
$ docker search --filter=is-automated=true --filter=stars=1 fedora
32-
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
33-
goldmann/wildfly A WildFly application server running on a ... 3 [OK]
34-
tutum/fedora-20 Fedora 20 image with SSH access. For the r... 1 [OK]
20+
NAME DESCRIPTION STARS OFFICIAL
21+
fedora Official Docker builds of Fedora 1150 [OK]

0 commit comments

Comments
 (0)