Fix keyerror on unnamed containers (#3765)

This commit is contained in:
Mike Degatano 2022-08-02 15:40:27 -04:00 committed by GitHub
parent d097044fa8
commit a45789c906
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,7 +63,7 @@ class DockerMonitor(CoreSysAttributes, Thread):
if event["Type"] == "container" and (
LABEL_MANAGED in attributes
or attributes["name"] in self._unlabeled_managed_containers
or attributes.get("name") in self._unlabeled_managed_containers
):
container_state: Optional[ContainerState] = None
action: str = event["Action"]