Potentially fixes #1
This commit is contained in:
parent
6af8cb3e1b
commit
8426640271
1 changed files with 8 additions and 7 deletions
|
@ -111,15 +111,16 @@ function getStatus(containers: Dockerode.ContainerInfo[], entry: Service) {
|
||||||
else if (entry.type === "docker") {
|
else if (entry.type === "docker") {
|
||||||
entry.status = ServiceStatus.offline;
|
entry.status = ServiceStatus.offline;
|
||||||
// Loop over every found container and compare to the entry provided
|
// Loop over every found container and compare to the entry provided
|
||||||
containers.forEach((element: Dockerode.ContainerInfo) => {
|
containers.forEach((container: Dockerode.ContainerInfo) => {
|
||||||
element.Names.forEach((containerName: string) => {
|
console.log(container)
|
||||||
if (containerName.startsWith("/")) {
|
if (container.Names.includes("/" + entry.docker_container_name) || container.Names.includes(entry.docker_container_name)) {
|
||||||
containerName = containerName.substring(1);
|
if (container.State === "running") {
|
||||||
}
|
|
||||||
if (containerName === entry.docker_container_name) {
|
|
||||||
entry.status = ServiceStatus.online;
|
entry.status = ServiceStatus.online;
|
||||||
}
|
}
|
||||||
});
|
else {
|
||||||
|
entry.status = ServiceStatus.offline;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (entry.docker_container_name == null) {
|
if (entry.docker_container_name == null) {
|
||||||
console.log("MISSING DOCKER CONTAINER NAME FOR " + entry.name);
|
console.log("MISSING DOCKER CONTAINER NAME FOR " + entry.name);
|
||||||
entry.status = ServiceStatus.error;
|
entry.status = ServiceStatus.error;
|
||||||
|
|
Loading…
Reference in a new issue