diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-05-09 23:04:23 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-09 23:04:23 +0200 |
commit | 3ff96383f306cecfeed75986078144ad757e3d70 (patch) | |
tree | 301a71ee7621be9d6bfd1b77552c1574f5fc18d2 /pkg/api | |
parent | 2a6487c4aaa312e9284d223540e971b109d0fcf2 (diff) | |
parent | 931bd5ace6d6efa19e0b123d8d70b273ea79d5ab (diff) | |
download | podman-3ff96383f306cecfeed75986078144ad757e3d70.tar.gz podman-3ff96383f306cecfeed75986078144ad757e3d70.tar.bz2 podman-3ff96383f306cecfeed75986078144ad757e3d70.zip |
Merge pull request #6148 from jwhonce/wip/version
V2 Implement tunnelled podman version
Diffstat (limited to 'pkg/api')
-rw-r--r-- | pkg/api/handlers/compat/version.go | 3 | ||||
-rw-r--r-- | pkg/api/handlers/types.go | 4 | ||||
-rw-r--r-- | pkg/api/server/register_version.go | 21 | ||||
-rw-r--r-- | pkg/api/server/swagger.go | 9 |
4 files changed, 32 insertions, 5 deletions
diff --git a/pkg/api/handlers/compat/version.go b/pkg/api/handlers/compat/version.go index 35a95b562..8786f1d5b 100644 --- a/pkg/api/handlers/compat/version.go +++ b/pkg/api/handlers/compat/version.go @@ -10,6 +10,7 @@ import ( "github.com/containers/libpod/libpod/define" "github.com/containers/libpod/pkg/api/handlers" "github.com/containers/libpod/pkg/api/handlers/utils" + "github.com/containers/libpod/pkg/domain/entities" docker "github.com/docker/docker/api/types" "github.com/pkg/errors" ) @@ -46,7 +47,7 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) { }, }} - utils.WriteResponse(w, http.StatusOK, handlers.Version{Version: docker.Version{ + utils.WriteResponse(w, http.StatusOK, entities.ComponentVersion{Version: docker.Version{ Platform: struct { Name string }{ diff --git a/pkg/api/handlers/types.go b/pkg/api/handlers/types.go index a7abf59c0..2075d29df 100644 --- a/pkg/api/handlers/types.go +++ b/pkg/api/handlers/types.go @@ -71,10 +71,6 @@ type Container struct { docker.ContainerCreateConfig } -type Version struct { - docker.Version -} - type DiskUsage struct { docker.DiskUsage } diff --git a/pkg/api/server/register_version.go b/pkg/api/server/register_version.go index 25cacbc61..30289ffe3 100644 --- a/pkg/api/server/register_version.go +++ b/pkg/api/server/register_version.go @@ -8,7 +8,28 @@ import ( ) func (s *APIServer) registerVersionHandlers(r *mux.Router) error { + // swagger:operation GET /version compat CompatSystemVersion + // --- + // summary: Component Version information + // tags: + // - system (compat) + // produces: + // - application/json + // responses: + // 200: + // $ref: "#/responses/Version" r.Handle("/version", s.APIHandler(compat.VersionHandler)).Methods(http.MethodGet) r.Handle(VersionedPath("/version"), s.APIHandler(compat.VersionHandler)).Methods(http.MethodGet) + // swagger:operation GET /libpod/version libpod SystemVersion + // --- + // summary: Component Version information + // tags: + // - system + // produces: + // - application/json + // responses: + // 200: + // $ref: "#/responses/Version" + r.Handle(VersionedPath("/libpod/version"), s.APIHandler(compat.VersionHandler)).Methods(http.MethodGet) return nil } diff --git a/pkg/api/server/swagger.go b/pkg/api/server/swagger.go index 75dcc71a6..e47f2cc2f 100644 --- a/pkg/api/server/swagger.go +++ b/pkg/api/server/swagger.go @@ -181,3 +181,12 @@ type swagHealthCheckRunResponse struct { define.HealthCheckResults } } + +// Version +// swagger:response Version +type swagVersion struct { + // in:body + Body struct { + entities.SystemVersionReport + } +} |