Skip to content

Commit

Permalink
fix for exited showing
Browse files Browse the repository at this point in the history
  • Loading branch information
petersem committed Sep 2, 2024
1 parent ce38b6b commit 4884fe1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit 4884fe1

Please sign in to comment.