diff --git a/api/server/router/system/system_routes.go b/api/server/router/system/system_routes.go index 6e16b708fb..3fc02281fa 100644 --- a/api/server/router/system/system_routes.go +++ b/api/server/router/system/system_routes.go @@ -16,6 +16,7 @@ import ( "github.com/docker/docker/api/types/registry" timetypes "github.com/docker/docker/api/types/time" "github.com/docker/docker/api/types/versions" + "github.com/docker/docker/api/types/versions/v1p24" "github.com/docker/docker/pkg/ioutils" "golang.org/x/net/context" ) @@ -41,21 +42,16 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht if versions.LessThan(httputils.VersionFromContext(ctx), "1.25") { // TODO: handle this conversion in engine-api - type oldInfo struct { - *types.InfoBase - ExecutionDriver string - SecurityOptions []string - } - old := &oldInfo{ + oldInfo := &v1p24.Info{ InfoBase: info.InfoBase, ExecutionDriver: "", } for _, s := range info.SecurityOptions { if s.Key == "Name" { - old.SecurityOptions = append(old.SecurityOptions, s.Value) + oldInfo.SecurityOptions = append(oldInfo.SecurityOptions, s.Value) } } - return httputils.WriteJSON(w, http.StatusOK, old) + return httputils.WriteJSON(w, http.StatusOK, oldInfo) } return httputils.WriteJSON(w, http.StatusOK, info) } diff --git a/api/types/versions/v1p24/types.go b/api/types/versions/v1p24/types.go new file mode 100644 index 0000000000..8289d2c49a --- /dev/null +++ b/api/types/versions/v1p24/types.go @@ -0,0 +1,10 @@ +// Package v1p24 provides specific API types for the API version 1, patch 24. +package v1p24 + +import "github.com/docker/docker/api/types" + +type Info struct { + *types.InfoBase + ExecutionDriver string + SecurityOptions []string +} diff --git a/client/client.go b/client/client.go index 9dcb3986cf..3b97720e00 100644 --- a/client/client.go +++ b/client/client.go @@ -58,7 +58,7 @@ import ( ) // DefaultVersion is the version of the current stable API -const DefaultVersion string = "1.23" +const DefaultVersion string = "1.25" // Client is the API client that performs all operations // against a docker server.