diff options
author | Chris Akritidis <43294513+cakrit@users.noreply.github.com> | 2020-06-30 07:21:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-30 16:21:31 +0200 |
commit | 62ce25168560104393651c3754b102cd99945977 (patch) | |
tree | ed12cb7ffafbc25905a579d573fec21100cfdb04 /collectors/cgroups.plugin | |
parent | f9f381ff31a944f153daaa7e5bfcc7d1c1ad29b9 (diff) |
Show cgroups/containers ran by kubelet without access to kubernetes cluster information (#9321)
Diffstat (limited to 'collectors/cgroups.plugin')
-rwxr-xr-x | collectors/cgroups.plugin/cgroup-name.sh.in | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/collectors/cgroups.plugin/cgroup-name.sh.in b/collectors/cgroups.plugin/cgroup-name.sh.in index ab16e673d9..ad0ab0b663 100755 --- a/collectors/cgroups.plugin/cgroup-name.sh.in +++ b/collectors/cgroups.plugin/cgroup-name.sh.in @@ -181,7 +181,11 @@ done if [ -z "${NAME}" ]; then if [[ ${CGROUP} =~ ^.*kubepods.* ]]; then k8s_get_name "${CGROUP}" - elif [[ ${CGROUP} =~ ^.*docker[-_/\.][a-fA-F0-9]+[-_\.]?.*$ ]]; then + fi +fi + +if [ -z "${NAME}" ]; then + if [[ ${CGROUP} =~ ^.*docker[-_/\.][a-fA-F0-9]+[-_\.]?.*$ ]]; then # docker containers #shellcheck disable=SC1117 DOCKERID="$(echo "${CGROUP}" | sed "s|^.*docker[-_/]\([a-fA-F0-9]\+\)[-_\.]\?.*$|\1|")" |