diff --git a/api/server/router/system/system_routes.go b/api/server/router/system/system_routes.go index a3ff4df7c8..5e508610d7 100644 --- a/api/server/router/system/system_routes.go +++ b/api/server/router/system/system_routes.go @@ -38,7 +38,7 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht info.Swarm = s.clusterProvider.Info() } - if versions.LessThan("1.25", httputils.VersionFromContext(ctx)) { + if versions.LessThan(httputils.VersionFromContext(ctx), "1.25") { // TODO: handle this conversion in engine-api type oldInfo struct { *types.Info diff --git a/integration-cli/docker_api_info_test.go b/integration-cli/docker_api_info_test.go index d4ad29b305..81334a9dd7 100644 --- a/integration-cli/docker_api_info_test.go +++ b/integration-cli/docker_api_info_test.go @@ -38,3 +38,15 @@ func (s *DockerSuite) TestInfoAPI(c *check.C) { c.Assert(out, checker.Contains, linePrefix) } } + +func (s *DockerSuite) TestInfoAPIVersioned(c *check.C) { + endpoint := "/v1.20/info" + + status, body, err := sockRequest("GET", endpoint, nil) + c.Assert(status, checker.Equals, http.StatusOK) + c.Assert(err, checker.IsNil) + + out := string(body) + c.Assert(out, checker.Contains, "ExecutionDriver") + c.Assert(out, checker.Contains, "not supported") +}