From cf32f036c0d685dd1999bd0c0108a31dcb6e45ab Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Mon, 30 Jun 2025 11:08:05 -0300 Subject: [PATCH] Fix `docker_home_assistant_execute_command` not honoring HA version (#5978) * Fix `docker_home_assistant_execute_command` not honoring HA version * Change variable name to image_with_tag * Fix test --- supervisor/docker/manager.py | 8 +++++--- tests/docker/test_manager.py | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/supervisor/docker/manager.py b/supervisor/docker/manager.py index 148fe92e4..fc4461c67 100644 --- a/supervisor/docker/manager.py +++ b/supervisor/docker/manager.py @@ -294,7 +294,7 @@ class DockerAPI: def run_command( self, image: str, - tag: str = "latest", + version: str = "latest", command: str | None = None, **kwargs: Any, ) -> CommandReturn: @@ -305,11 +305,13 @@ class DockerAPI: stdout = kwargs.get("stdout", True) stderr = kwargs.get("stderr", True) - _LOGGER.info("Runing command '%s' on %s", command, image) + image_with_tag = f"{image}:{version}" + + _LOGGER.info("Runing command '%s' on %s", command, image_with_tag) container = None try: container = self.docker.containers.run( - f"{image}:{tag}", + image_with_tag, command=command, network=self.network.name, use_config_proxy=False, diff --git a/tests/docker/test_manager.py b/tests/docker/test_manager.py index bc2f85cce..c06c2b3bc 100644 --- a/tests/docker/test_manager.py +++ b/tests/docker/test_manager.py @@ -22,7 +22,7 @@ async def test_run_command_success(docker: DockerAPI): # Execute the command result = docker.run_command( - image="alpine", tag="3.18", command="echo hello", stdout=True, stderr=True + image="alpine", version="3.18", command="echo hello", stdout=True, stderr=True ) # Verify the result