mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-09-28 06:35:24 +00:00
Support generating volume list in create/run format
This commit is contained in:
@@ -41,7 +41,25 @@ class Container:
|
|||||||
@property
|
@property
|
||||||
def environment(self):
|
def environment(self):
|
||||||
"""All configured env vars for the container"""
|
"""All configured env vars for the container"""
|
||||||
return self.get_config('Env', default={})
|
return self.get_config('Env', default=[])
|
||||||
|
|
||||||
|
@property
|
||||||
|
def volumes(self):
|
||||||
|
"""
|
||||||
|
Return volumes for the container in the following format:
|
||||||
|
{'/home/user1/': {'bind': '/mnt/vol2', 'mode': 'rw'},}
|
||||||
|
"""
|
||||||
|
# {'Type': 'bind',
|
||||||
|
# 'Source': '/Users/einarforselv/Documents/projects/contraz/restic-volume-backup',
|
||||||
|
# 'Destination': '/restic-volume-backup',
|
||||||
|
# 'Mode': 'rw',
|
||||||
|
# 'RW': True,
|
||||||
|
# 'Propagation': 'rprivate'}
|
||||||
|
volumes = {}
|
||||||
|
for mount in self._mounts:
|
||||||
|
volumes[mount.source] = {'bind': mount.destination, 'mode': 'ro'}
|
||||||
|
|
||||||
|
return volumes
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def backup_enabled(self) -> bool:
|
def backup_enabled(self) -> bool:
|
||||||
|
Reference in New Issue
Block a user