mirror of
https://github.com/ZettaIO/restic-compose-backup.git
synced 2025-09-28 06:35:24 +00:00
Do not filter mounts if volume backup is not enabled
This commit is contained in:
@@ -160,6 +160,10 @@ class Container:
|
||||
def filter_mounts(self):
|
||||
"""Get all mounts for this container matching include/exclude filters"""
|
||||
filtered = []
|
||||
|
||||
if not self.volume_backup_enabled:
|
||||
return filtered
|
||||
|
||||
if self._include:
|
||||
for mount in self._mounts:
|
||||
for pattern in self._include:
|
||||
|
@@ -59,6 +59,7 @@ class ResticBackupTests(unittest.TestCase):
|
||||
{
|
||||
'service': 'web',
|
||||
'labels': {
|
||||
'restic-compose-backup.volumes': True,
|
||||
'test': 'test',
|
||||
},
|
||||
'mounts': [{
|
||||
@@ -119,6 +120,7 @@ class ResticBackupTests(unittest.TestCase):
|
||||
{
|
||||
'service': 'web',
|
||||
'labels': {
|
||||
'restic-compose-backup.volumes': True,
|
||||
'restic-compose-backup.volumes.include': 'media',
|
||||
},
|
||||
'mounts': [
|
||||
@@ -152,6 +154,7 @@ class ResticBackupTests(unittest.TestCase):
|
||||
{
|
||||
'service': 'web',
|
||||
'labels': {
|
||||
'restic-compose-backup.volumes': True,
|
||||
'restic-compose-backup.volumes.exclude': 'stuff',
|
||||
},
|
||||
'mounts': [
|
||||
|
Reference in New Issue
Block a user