Skip to content

Commit ce38b6b

Browse files
committed
fixed issue where exited showed when should be hidden
1 parent 164e728 commit ce38b6b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

.dev-docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ services:
1515
EXCLUDE_EXITED: $EXCLUDE_EXITED
1616
PERIOD: $PERIOD
1717
DISABLE_STARTUP_MSG: $DISABLE_STARTUP_MSG
18-
SHA: 'true'
18+
SHA: 'false'
1919
CUSTOM_NTFY_SERVER: $CUSTOM_NTFY_SERVER
2020
NTFY_USER: $NTFY_USER
2121
NTFY_PASS: $NTFY_PASS

index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ async function list() {
352352
if (c.Status.includes("(unhealthy)")) hcStatus = "(unhealthy)"
353353
if (monContainers.includes(c.Id + "," + c.State + "," + c.Names[0] + "," + hcStatus) == false && monContainers.length !== 0) {
354354
// exclude exited status if set
355-
if (EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited' && (typeof query !== 'undefined' && query)) {
355+
if ((EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited') || (typeof query !== 'undefined' && query)) {
356356
// ignore
357357
}
358358
else {
@@ -405,7 +405,7 @@ async function list() {
405405
monContainers.forEach(c => {
406406
let delArray = newConArray.filter(nc => nc.includes(c.split(",")[0]));
407407
// if no match in history array and latest scan, then is deleted
408-
if(delArray.length==0 && EXCLUDE_EXITED !== 'true' && (typeof c.Id !== 'undefined' && c.Id)){
408+
if((delArray.length==0 && EXCLUDE_EXITED !== 'true') || (typeof c.Id !== 'undefined' && c.Id)){
409409
var output = c.split(",")[2].replace("/","") + ": exited"
410410
if(SHA.toLowerCase()=='true'){
411411
output += " " + c.Id

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monocker",
3-
"version": "2.13.2",
3+
"version": "2.13.3",
44
"description": "Monitors and alerts for docker containers state changes",
55
"type": "module",
66
"main": "index.js",

0 commit comments

Comments
 (0)