mirror of
https://github.com/bbernhard/signal-cli-rest-api.git
synced 2026-05-29 15:14:28 +00:00
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:
parent
f52f177a72
commit
5330e0dff5
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user