Skip to content

Commit 1b1147e

Browse files
committed
api: POST /commit: remove version-gate for "pause" (api < v1.16)
The "pause" flag was added in API v1.13 (Docker Engine v1.1.0), and is enabled by default (see 17d870b). API v1.23 and older are deprecated, so we can remove the version-gate. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent d26bdfe commit 1b1147e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

api/server/router/container/container_routes.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ func (s *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter,
3939
return err
4040
}
4141

42-
// TODO: remove pause arg, and always pause in backend
43-
pause := httputils.BoolValue(r, "pause")
44-
version := httputils.VersionFromContext(ctx)
45-
if r.FormValue("pause") == "" && versions.GreaterThanOrEqualTo(version, "1.13") {
46-
pause = true
47-
}
48-
4942
config, _, _, err := s.decoder.DecodeConfig(r.Body)
5043
if err != nil && !errors.Is(err, io.EOF) { // Do not fail if body is empty.
5144
return err
@@ -57,7 +50,7 @@ func (s *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter,
5750
}
5851

5952
imgID, err := s.backend.CreateImageFromContainer(ctx, r.Form.Get("container"), &backend.CreateImageConfig{
60-
Pause: pause,
53+
Pause: httputils.BoolValueOrDefault(r, "pause", true), // TODO(dnephin): remove pause arg, and always pause in backend
6154
Tag: ref,
6255
Author: r.Form.Get("author"),
6356
Comment: r.Form.Get("comment"),

0 commit comments

Comments
 (0)