Fix attempt for Container name checking

This commit is contained in:
Neshura 2022-12-11 16:48:09 +01:00
parent 3bd10e1f94
commit a27f7457aa
No known key found for this signature in database
GPG key ID: ACDF5B6EBECF6B0A

View file

@ -108,8 +108,8 @@ async function getStatus(entry: Service, containers: Dockerode.ContainerInfo[])
// Type Docker
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)) || (container.Names.includes( "/" + entry.docker_container_name))) {
// Docker API returns container names with / prepended
if (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":