aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Karlitski <lars@karlitski.net>2019-02-04 19:04:08 +0100
committerLars Karlitski <lars@karlitski.net>2019-02-12 14:47:49 +0100
commit27baf9970e1267f4ad48692a4465e7b61310af4a (patch)
treefef5811ce14031ac1c67fab713285f1090ae32cb
parent29392b77e90b59e6f7b7d78db78c9c0ae045bc06 (diff)
downloadpodman-27baf9970e1267f4ad48692a4465e7b61310af4a.tar.gz
podman-27baf9970e1267f4ad48692a4465e7b61310af4a.tar.bz2
podman-27baf9970e1267f4ad48692a4465e7b61310af4a.zip
varlink: Simplify GetVersion() call
Not having the `Version` wrapper type makes it easier for clients to work with the returned data. Signed-off-by: Lars Karlitski <lars@karlitski.net>
-rw-r--r--cmd/podman/varlink/io.podman.varlink22
-rw-r--r--pkg/varlinkapi/system.go16
2 files changed, 17 insertions, 21 deletions
diff --git a/cmd/podman/varlink/io.podman.varlink b/cmd/podman/varlink/io.podman.varlink
index 29c993dd6..51f0592dd 100644
--- a/cmd/podman/varlink/io.podman.varlink
+++ b/cmd/podman/varlink/io.podman.varlink
@@ -3,16 +3,6 @@
interface io.podman
-# Version is the structure returned by GetVersion
-type Version (
- version: string,
- go_version: string,
- git_commit: string,
- built: string, # as RFC3339
- os_arch: string,
- remote_api_version: int
-)
-
# ContainerChanges describes the return struct for ListContainerChanges
type ContainerChanges (
changed: []string,
@@ -399,9 +389,15 @@ type Runlabel(
opts: [string]string
)
-# GetVersion returns a Version structure describing the libpod setup on their
-# system.
-method GetVersion() -> (version: Version)
+# GetVersion returns version and build information of the podman service
+method GetVersion() -> (
+ version: string,
+ go_version: string,
+ git_commit: string,
+ built: string, # as RFC3339
+ os_arch: string,
+ remote_api_version: int
+)
# GetInfo returns a [PodmanInfo](#PodmanInfo) struct that describes podman and its host such as storage stats,
# build information of Podman, and system-wide registries.
diff --git a/pkg/varlinkapi/system.go b/pkg/varlinkapi/system.go
index a64dc4217..3f32615ec 100644
--- a/pkg/varlinkapi/system.go
+++ b/pkg/varlinkapi/system.go
@@ -16,14 +16,14 @@ func (i *LibpodAPI) GetVersion(call iopodman.VarlinkCall) error {
return err
}
- return call.ReplyGetVersion(iopodman.Version{
- Remote_api_version: versionInfo.RemoteAPIVersion,
- Version: versionInfo.Version,
- Go_version: versionInfo.GoVersion,
- Git_commit: versionInfo.GitCommit,
- Built: time.Unix(versionInfo.Built, 0).Format(time.RFC3339),
- Os_arch: versionInfo.OsArch,
- })
+ return call.ReplyGetVersion(
+ versionInfo.Version,
+ versionInfo.GoVersion,
+ versionInfo.GitCommit,
+ time.Unix(versionInfo.Built, 0).Format(time.RFC3339),
+ versionInfo.OsArch,
+ versionInfo.RemoteAPIVersion,
+ )
}
// GetInfo returns details about the podman host and its stores