Skip to content

Commit 4905144

Browse files
committedJul 5, 2024·
Improve error handling when determining Podman (API) version
1 parent f302fe1 commit 4905144

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)
Please sign in to comment.