diff --git a/app/core/docker.py b/app/core/docker.py index f6f33c6..0a13aa6 100644 --- a/app/core/docker.py +++ b/app/core/docker.py @@ -263,11 +263,15 @@ def get_remote_hosts() -> List[str]: return sorted(remote_hosts) -def get_remote_containers(hostname: str) -> List[Dict]: +def get_remote_containers(hostname: str, include_stopped: bool = False) -> List[Dict]: """ Получает список контейнеров для удаленного хоста Автор: Сергей Антропов Сайт: https://devops.org.ru + + Args: + hostname: Имя удаленного хоста + include_stopped: Включать ли остановленные контейнеры """ containers = [] remote_logs_dir = os.path.join(os.getcwd(), 'logs', 'remote', hostname) @@ -355,7 +359,7 @@ def list_containers_with_remote(projects: Optional[List[str]] = None, include_st for hostname in remote_hosts: # Проверяем, нужно ли включать этот хост if projects is None or any(f"remote-{hostname}" in project for project in projects): - host_containers = get_remote_containers(hostname) + host_containers = get_remote_containers(hostname, include_stopped) remote_containers.extend(host_containers) # Объединяем локальные и удаленные контейнеры