Skip to content

Commit 5330e0d

Browse files
committed
fixed getContainerId() function
* since switching to podman builds in the CI, the getContainerId() function wasn't working anymore. As per default the hostname of the container is the same as the container id, we use the GetHostname() function to get the container id inside the container.
1 parent f52f177 commit 5330e0d

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

src/client/client.go

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -288,16 +288,7 @@ func parseWhitespaceDelimitedKeyValueStringList(in string, keys []string) []map[
288288
}
289289

290290
func getContainerId() (string, error) {
291-
data, err := ioutil.ReadFile("/proc/1/cpuset")
292-
if err != nil {
293-
return "", err
294-
}
295-
lines := strings.Split(string(data), "\n")
296-
if len(lines) == 0 {
297-
return "", errors.New("Couldn't get docker container id (empty)")
298-
}
299-
containerId := strings.Replace(lines[0], "/docker/", "", -1)
300-
return containerId, nil
291+
return os.Hostname()
301292
}
302293

303294
func ConvertGroupIdToInternalGroupId(id string) (string, error) {

0 commit comments

Comments
 (0)