From 16223ab0f1710953890ad9171512bb5abd83c43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20=C5=98ezn=C3=AD=C4=8Dek?= <246254@mail.muni.cz> Date: Tue, 13 Jul 2021 08:18:43 +0000 Subject: [PATCH] fix: container id assert expects /docker/ prefix --- CHANGELOG.md | 4 ++++ src/metric-generators/dockermon.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6be86f0..72034e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.4] - 2021-07-13 +### Fixed +- dockermon id assert corrected, now expects `/docker/` prefix + ## [1.0.3] - 2021-07-12 ### Fixed - compliance with cAdvisor: diff --git a/src/metric-generators/dockermon.sh b/src/metric-generators/dockermon.sh index ee2a7ca..f60dcfc 100755 --- a/src/metric-generators/dockermon.sh +++ b/src/metric-generators/dockermon.sh @@ -20,7 +20,7 @@ for i_container in ${CONTAINERS}; do i_container_id="/docker/$(echo "${i_container_status}" | jq -r '.[].Id')" test -n "${i_container_name}" echo -n "${i_container_restart_count}" | grep -Eq "^[0-9]+$" - echo -n "${i_container_id}" | grep -Eq "^[a-fA-F0-9]{12,}$" + echo -n "${i_container_id}" | grep -Eq "^/docker/[a-fA-F0-9]{12,}$" CONTAINER_IDS+=("${i_container_id}") CONTAINER_NAMES+=("${i_container_name}") CONTAINER_RESTART_COUNTS+=("${i_container_restart_count}") -- GitLab