Skip to content

Commit

Permalink
Merge pull request moby#40491 from thaJeztah/remove_deprecated_filter…
Browse files Browse the repository at this point in the history
…s_opt

API: remove deprecated "filter" parameter for API v1.41 and up
  • Loading branch information
thaJeztah committed Feb 11, 2020
2 parents 853e123 + 4a19009 commit cb3ec99
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/server/router/image/image_routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,12 @@ func (s *imageRouter) getImagesJSON(ctx context.Context, w http.ResponseWriter,
return err
}

filterParam := r.Form.Get("filter")
// FIXME(vdemeester) This has been deprecated in 1.13, and is target for removal for v17.12
if filterParam != "" {
imageFilters.Add("reference", filterParam)
version := httputils.VersionFromContext(ctx)
if versions.LessThan(version, "1.41") {
filterParam := r.Form.Get("filter")
if filterParam != "" {
imageFilters.Add("reference", filterParam)
}
}

images, err := s.backend.Images(imageFilters, httputils.BoolValue(r, "all"), false)
Expand Down
3 changes: 3 additions & 0 deletions docs/api/version-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ keywords: "API, Docker, rcli, REST, documentation"

[Docker Engine API v1.41](https://docs.docker.com/engine/api/v1.41/) documentation

* The `filter` (singular) query parameter, which was deprecated in favor of the
`filters` option in Docker 1.13, has now been removed from the `GET /images/json`
endpoint. The parameter remains available when using API version 1.40 or below.
* `GET /services` now returns `Capabilities` as part of the `ContainerSpec`.
* `GET /services/{id}` now returns `Capabilities` as part of the `ContainerSpec`.
* `POST /services/create` now accepts `Capabilities` as part of the `ContainerSpec`.
Expand Down

0 comments on commit cb3ec99

Please sign in to comment.