diff options
author | Keith Mitchell <keith.mitchell@live.ca> | 2022-08-01 03:23:32 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-01 13:23:32 +0300 |
commit | 8db672d4e685d49853c61ae988d7b983ef1fa5d9 (patch) | |
tree | 34932172c9a32af2b9b6c8812d36aebb31ae8d17 /collectors/cgroups.plugin | |
parent | bfe964bfbb52bd21c23e941faa37be0ef00df95b (diff) |
Fix cgroup name detection for docker containers in containerd cgroup (#13470)
Diffstat (limited to 'collectors/cgroups.plugin')
-rwxr-xr-x | collectors/cgroups.plugin/cgroup-name.sh | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/collectors/cgroups.plugin/cgroup-name.sh b/collectors/cgroups.plugin/cgroup-name.sh index 4716d41494..002f4ff9e7 100755 --- a/collectors/cgroups.plugin/cgroup-name.sh +++ b/collectors/cgroups.plugin/cgroup-name.sh @@ -518,6 +518,11 @@ if [ -z "${NAME}" ]; then #shellcheck disable=SC1117 DOCKERID="$(echo "${CGROUP}" | sed "s|^.*ecs[-_/].*[-_/]\([a-fA-F0-9]\+\)[-_\.]\?.*$|\1|")" docker_validate_id "${DOCKERID}" + elif [[ ${CGROUP} =~ system.slice_containerd.service_cpuset_[a-fA-F0-9]+[-_\.]?.*$ ]]; then + # docker containers under containerd + #shellcheck disable=SC1117 + DOCKERID="$(echo "${CGROUP}" | sed "s|^.*ystem.slice_containerd.service_cpuset_\([a-fA-F0-9]\+\)[-_\.]\?.*$|\1|")" + docker_validate_id "${DOCKERID}" elif [[ ${CGROUP} =~ ^.*libpod-[a-fA-F0-9]+.*$ ]]; then # Podman PODMANID="$(echo "${CGROUP}" | sed "s|^.*libpod-\([a-fA-F0-9]\+\).*$|\1|")" |