mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-12-17 02:54:18 +00:00
Only obtain containers with backup enabled
This commit is contained in:
@@ -58,7 +58,7 @@ class Container:
|
||||
@property
|
||||
def backup_enabled(self) -> bool:
|
||||
"""Is backup enabled for this container?"""
|
||||
return self.get_label('restic-volume-backup.enabled') == 'True'
|
||||
return self.get_label('restic-volume-backup.enabled') is not None
|
||||
|
||||
@property
|
||||
def is_backup_process_container(self) -> bool:
|
||||
@@ -225,6 +225,10 @@ class RunningContainers:
|
||||
"""Is the backup process container running?"""
|
||||
return self.backup_process_container is not None
|
||||
|
||||
def containers_for_backup(self):
|
||||
"""Obtain all containers with backup enabled"""
|
||||
return [container for container in self.containers if container.backup_enabled]
|
||||
|
||||
def get_service(self, name) -> Container:
|
||||
for container in self.containers:
|
||||
if container.service_name == name:
|
||||
|
||||
Reference in New Issue
Block a user