Merge pull request #35705 from tiborvass/platform-version
api: generalize version information to any platform component Upstream-commit: a1be987ea9e03e5ebdb1b415a7acdd8d6f0aaa08 Component: engine
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/docker/docker/api"
|
||||
"github.com/docker/docker/api/server/httputils"
|
||||
"github.com/docker/docker/api/types"
|
||||
"github.com/docker/docker/api/types/events"
|
||||
@@ -65,7 +64,6 @@ func (s *systemRouter) getInfo(ctx context.Context, w http.ResponseWriter, r *ht
|
||||
|
||||
func (s *systemRouter) getVersion(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
|
||||
info := s.backend.SystemVersion()
|
||||
info.APIVersion = api.DefaultVersion
|
||||
|
||||
return httputils.WriteJSON(w, http.StatusOK, info)
|
||||
}
|
||||
|
||||
@@ -6761,6 +6761,28 @@ paths:
|
||||
schema:
|
||||
type: "object"
|
||||
properties:
|
||||
Platform:
|
||||
type: "object"
|
||||
required: [Name]
|
||||
properties:
|
||||
Name:
|
||||
type: "string"
|
||||
Components:
|
||||
type: "array"
|
||||
items:
|
||||
type: "object"
|
||||
x-go-name: ComponentVersion
|
||||
required: [Name, Version]
|
||||
properties:
|
||||
Name:
|
||||
type: "string"
|
||||
Version:
|
||||
type: "string"
|
||||
x-nullable: false
|
||||
Details:
|
||||
type: "object"
|
||||
x-nullable: true
|
||||
|
||||
Version:
|
||||
type: "string"
|
||||
ApiVersion:
|
||||
|
||||
@@ -107,9 +107,21 @@ type Ping struct {
|
||||
Experimental bool
|
||||
}
|
||||
|
||||
// ComponentVersion describes the version information for a specific component.
|
||||
type ComponentVersion struct {
|
||||
Name string
|
||||
Version string
|
||||
Details map[string]string `json:",omitempty"`
|
||||
}
|
||||
|
||||
// Version contains response of Engine API:
|
||||
// GET "/version"
|
||||
type Version struct {
|
||||
Platform struct{ Name string } `json:",omitempty"`
|
||||
Components []ComponentVersion `json:",omitempty"`
|
||||
|
||||
// The following fields are deprecated, they relate to the Engine component and are kept for backwards compatibility
|
||||
|
||||
Version string
|
||||
APIVersion string `json:"ApiVersion"`
|
||||
MinAPIVersion string `json:"MinAPIVersion,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user