Skip to content

Commit 6deb0a2

Browse files
committed
Expose Podman version info
1 parent c42160e commit 6deb0a2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

container/podman/podman.go

+19-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,15 @@ func Status() (v1.DockerStatus, error) {
108108
return v1.DockerStatus{}, err
109109
}
110110

111-
return docker.StatusFromDockerInfo(*podmanInfo)
111+
status, err := docker.StatusFromDockerInfo(*podmanInfo);
112+
if err != nil {
113+
return v1.DockerStatus{}, err
114+
}
115+
116+
status.Version, _ = VersionString()
117+
status.APIVersion, _ = APIVersionString()
118+
119+
return status, nil
112120
}
113121

114122
func GetInfo() (*dockersystem.Info, error) {
@@ -127,6 +135,16 @@ func VersionString() (string, error) {
127135
return version.Version, nil
128136
}
129137

138+
func APIVersionString() (string, error) {
139+
var version dockertypes.Version
140+
err := apiGetRequest("http://d/v1.0.0/version", &version)
141+
if err != nil {
142+
return "Unknown", err
143+
}
144+
145+
return version.APIVersion, nil
146+
}
147+
130148
func InspectContainer(id string) (dockertypes.ContainerJSON, error) {
131149
var data dockertypes.ContainerJSON
132150
err := apiGetRequest(fmt.Sprintf("http://d/v1.0.0/containers/%s/json", id), &data)

0 commit comments

Comments
 (0)