diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-04-06 21:27:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-06 21:27:52 +0200 |
commit | 7d95e0c47ad7203c6ad3e5a0441a309e5368dc52 (patch) | |
tree | 94f380670abc8b55885d37f79c5232222d2e8b43 /pkg/api/handlers/compat/version.go | |
parent | 0519fa0f1e1697cd52f5ceb388117b64eefa7fc2 (diff) | |
parent | e20ecc733c878f0c4b67a21204f0d5ae11929bf0 (diff) | |
download | podman-7d95e0c47ad7203c6ad3e5a0441a309e5368dc52.tar.gz podman-7d95e0c47ad7203c6ad3e5a0441a309e5368dc52.tar.bz2 podman-7d95e0c47ad7203c6ad3e5a0441a309e5368dc52.zip |
Merge pull request #5507 from baude/newinfo
refactor info
Diffstat (limited to 'pkg/api/handlers/compat/version.go')
-rw-r--r-- | pkg/api/handlers/compat/version.go | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/pkg/api/handlers/compat/version.go b/pkg/api/handlers/compat/version.go index c7f7917ac..35a95b562 100644 --- a/pkg/api/handlers/compat/version.go +++ b/pkg/api/handlers/compat/version.go @@ -30,8 +30,6 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) { utils.Error(w, "Something went wrong.", http.StatusInternalServerError, errors.Wrapf(err, "Failed to obtain system memory info")) return } - hostInfo := infoData[0].Data - components := []docker.ComponentVersion{{ Name: "Podman Engine", Version: versionInfo.Version, @@ -42,7 +40,7 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) { "Experimental": "true", "GitCommit": versionInfo.GitCommit, "GoVersion": versionInfo.GoVersion, - "KernelVersion": hostInfo["kernel"].(string), + "KernelVersion": infoData.Host.Kernel, "MinAPIVersion": handlers.MinimalApiVersion, "Os": goRuntime.GOOS, }, @@ -52,7 +50,7 @@ func VersionHandler(w http.ResponseWriter, r *http.Request) { Platform: struct { Name string }{ - Name: fmt.Sprintf("%s/%s/%s", goRuntime.GOOS, goRuntime.GOARCH, hostInfo["Distribution"].(map[string]interface{})["distribution"].(string)), + Name: fmt.Sprintf("%s/%s/%s-%s", goRuntime.GOOS, goRuntime.GOARCH, infoData.Host.Distribution.Distribution, infoData.Host.Distribution.Version), }, APIVersion: components[0].Details["APIVersion"], Arch: components[0].Details["Arch"], |