Show cgroups/containers ran by kubelet without access to kubernetes cluster information (#9321)
Chris Akritidis committed
Jun 30, 2020 at 07:21 UTC
62ce25168560104393651c3754b102cd99945977
1 file changed
+5
-1
collectors/cgroups.plugin/cgroup-name.sh.in
+5
-1
@@ -181,7 +181,11 @@ done
181
if [ -z "${NAME}" ]; then
182
if [[ ${CGROUP} =~ ^.*kubepods.* ]]; then
183
k8s_get_name "${CGROUP}"
184
- elif [[ ${CGROUP} =~ ^.*docker[-_/\.][a-fA-F0-9]+[-_\.]?.*$ ]]; then
184
+ fi
185
+fi
186
+
187
+if [ -z "${NAME}" ]; then
188
+ if [[ ${CGROUP} =~ ^.*docker[-_/\.][a-fA-F0-9]+[-_\.]?.*$ ]]; then
189
# docker containers
190
#shellcheck disable=SC1117
191
DOCKERID="$(echo "${CGROUP}" | sed "s|^.*docker[-_/]\([a-fA-F0-9]\+\)[-_\.]\?.*$|\1|")"