From 4884fe16556bcfd42dafc4b40a579d0d2cc40efc Mon Sep 17 00:00:00 2001 From: Matthew Petersen Date: Mon, 2 Sep 2024 21:01:42 +1000 Subject: [PATCH] fix for exited showing --- index.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index b66aab7..de33211 100644 --- a/index.js +++ b/index.js @@ -352,7 +352,7 @@ async function list() { if (c.Status.includes("(unhealthy)")) hcStatus = "(unhealthy)" if (monContainers.includes(c.Id + "," + c.State + "," + c.Names[0] + "," + hcStatus) == false && monContainers.length !== 0) { // exclude exited status if set - if ((EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited') || (typeof query !== 'undefined' && query)) { + if ((EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited') || ((typeof query !== 'undefined' && query) || c.Id)) { // ignore } else { @@ -405,7 +405,7 @@ async function list() { monContainers.forEach(c => { let delArray = newConArray.filter(nc => nc.includes(c.split(",")[0])); // if no match in history array and latest scan, then is deleted - if((delArray.length==0 && EXCLUDE_EXITED !== 'true') || (typeof c.Id !== 'undefined' && c.Id)){ + if((delArray.length==0 && EXCLUDE_EXITED !== 'true') || (typeof c.Id !== 'undefined' || c.Id)){ var output = c.split(",")[2].replace("/","") + ": exited" if(SHA.toLowerCase()=='true'){ output += " " + c.Id diff --git a/package.json b/package.json index a5fafe5..546f6e4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monocker", - "version": "2.13.3", + "version": "2.13.4", "description": "Monitors and alerts for docker containers state changes", "type": "module", "main": "index.js",