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.
This commit is contained in:
Bernhard B 2025-08-26 23:15:47 +02:00
parent f52f177a72
commit 5330e0dff5

View File

@ -288,16 +288,7 @@ func parseWhitespaceDelimitedKeyValueStringList(in string, keys []string) []map[
}
func getContainerId() (string, error) {
data, err := ioutil.ReadFile("/proc/1/cpuset")
if err != nil {
return "", err
}
lines := strings.Split(string(data), "\n")
if len(lines) == 0 {
return "", errors.New("Couldn't get docker container id (empty)")
}
containerId := strings.Replace(lines[0], "/docker/", "", -1)
return containerId, nil
return os.Hostname()
}
func ConvertGroupIdToInternalGroupId(id string) (string, error) {