mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-13 12:16:29 +00:00
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
This commit is contained in:
parent
b8852872fe
commit
cf32f036c0
@ -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,
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user