Skip to content

Commit 31c860f

Browse files
committed
Improve error handling when determining Podman (API) version
1 parent 6deb0a2 commit 31c860f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

container/podman/podman.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,19 @@ func Status() (v1.DockerStatus, error) {
113113
return v1.DockerStatus{}, err
114114
}
115115

116-
status.Version, _ = VersionString()
117-
status.APIVersion, _ = APIVersionString()
116+
podmanVersion, err := VersionString()
117+
if err != nil {
118+
// status.Version will be "Unknown"
119+
return status, err
120+
}
121+
status.Version = podmanVersion
122+
123+
podmanAPIVersion, err := APIVersionString()
124+
if err != nil {
125+
// status.APIVersion will be "Unknown"
126+
return status, err
127+
}
128+
status.APIVersion = podmanAPIVersion
118129

119130
return status, nil
120131
}

0 commit comments

Comments
 (0)