Fixed docker container name checking

This commit is contained in:
Neshura 2022-12-11 16:37:59 +01:00
parent 3303008ec3
commit c1d6f5d62e
No known key found for this signature in database
GPG key ID: ACDF5B6EBECF6B0A

View file

@ -109,7 +109,7 @@ async function getStatus(entry: Service, containers: Dockerode.ContainerInfo[])
else if (entry.type === ServiceType.docker) {
containers.forEach((container) => {
// Docker API returns container names with / prepended, not sure whether this always happens so both cases are checked
if (container.Names.includes( entry.docker_container_name || "/" + entry.docker_container_name)) {
if ((container.Names.includes( entry.docker_container_name)) || (container.Names.includes( "/" + entry.docker_container_name))) {
// so far only "running" is properly implemented, mroe cases to follow as needed
switch (container.State) {
case "running":