Skip to content

Commit

Permalink
Update to remove output for interim watchtower containers.
Browse files Browse the repository at this point in the history
  • Loading branch information
petersem committed Aug 28, 2024
1 parent c283910 commit 164e728
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 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') {
if (EXCLUDE_EXITED == 'true' && c.State.toLocaleLowerCase() == 'exited' && (typeof query !== 'undefined' && query)) {
// ignore
}
else {
Expand Down Expand Up @@ -405,10 +405,11 @@ 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'){
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.ImageID
output += " " + c.Id
console.log(c);
}
console.log(" - " + output);
//send(output)
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.1",
"version": "2.13.2",
"description": "Monitors and alerts for docker containers state changes",
"type": "module",
"main": "index.js",
Expand Down

0 comments on commit 164e728

Please sign in to comment.