summaryrefslogtreecommitdiff
path: root/pkg/api/handlers/compat/version.go
diff options
context:
space:
mode:
authorBrent Baude <bbaude@redhat.com>2020-03-15 11:53:59 -0500
committerBrent Baude <bbaude@redhat.com>2020-04-06 12:45:42 -0500
commite20ecc733c878f0c4b67a21204f0d5ae11929bf0 (patch)
tree8686fd9c9f123cbed11f0589655caaa128b12061 /pkg/api/handlers/compat/version.go
parente318b09b6800ddb013ddf3b9a2fb99ebc55bd920 (diff)
downloadpodman-e20ecc733c878f0c4b67a21204f0d5ae11929bf0.tar.gz
podman-e20ecc733c878f0c4b67a21204f0d5ae11929bf0.tar.bz2
podman-e20ecc733c878f0c4b67a21204f0d5ae11929bf0.zip
refactor info
the current implementation of info, while typed, is very loosely done so. we need stronger types for our apiv2 implmentation and bindings. Signed-off-by: Brent Baude <bbaude@redhat.com>
Diffstat (limited to 'pkg/api/handlers/compat/version.go')
-rw-r--r--pkg/api/handlers/compat/version.go6
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"],