fix volume backupper without socket proxy
This commit is contained in:
parent
4a2f50adfe
commit
771a474b4f
1 changed files with 11 additions and 8 deletions
|
@ -11,7 +11,7 @@ if TYPE_CHECKING:
|
|||
EXTRA_ARGS = {
|
||||
"archive": {"type": "path"},
|
||||
"backup_volumes": {"type": "list", "elements": "str", "required": True},
|
||||
"docker_socket_proxy": {"type": "str"}
|
||||
"docker_socket_proxy": {"type": "str"},
|
||||
}
|
||||
|
||||
|
||||
|
@ -41,6 +41,15 @@ def helper(state: State, params: dict[str, Any]) -> dict[str, Any]:
|
|||
|
||||
if socket_proxy:
|
||||
environment["DOCKER_HOST"] = f"tcp://{socket_proxy}:2375"
|
||||
else:
|
||||
volumes.append(
|
||||
{
|
||||
"type": "bind",
|
||||
"source": "/var/run/docker.sock",
|
||||
"target": "/var/run/docker.sock",
|
||||
"read_only": False,
|
||||
},
|
||||
)
|
||||
|
||||
if archive:
|
||||
environment["BACKUP_ARCHIVE"] = "/archive"
|
||||
|
@ -53,10 +62,4 @@ def helper(state: State, params: dict[str, Any]) -> dict[str, Any]:
|
|||
},
|
||||
)
|
||||
|
||||
return {
|
||||
"environment": environment,
|
||||
"volumes": volumes,
|
||||
"networks": {
|
||||
"internal": {}
|
||||
}
|
||||
}
|
||||
return {"environment": environment, "volumes": volumes, "networks": {"internal": {}}}
|
||||
|
|
Loading…
Add table
Reference in a new issue